目前,在iOS7中,过时的api有如下一些:


1.Map Kit framework中的MKOverlayView和它相关的子类都已经过时了。并且使用MKOverlayRenderer类来代替。更多相关资料,请看Map Kit Framework Reference。

 

2.在Audio Toolbox framework中的AudioSession API已经过时了。程序中应该使用AV Foundation framework中的AVAudioSession类来代替。

 

3.在Core Location framework中的CLRegion类已经被CLCircularRegion类取代了。只不过CLRegion类还继续存在着——当做一个抽象的基类——以对geographic和beacon region的支持。

 

4.CBCentral中的属性UUID已经过时了。现在使用identifier属性来对central对象进行唯一标示。

 

5.Game Kit framework中也有一些过时的api,主要是为了新功能提供更好的支持。相关信息请看上面提到的参考资料。

 

6.UIKit中有如下一些过时的内容:UIViewController的wantsFullScreenLayout属性已经过时。在iOS7以及之后的版本中,view controller一直都是全屏布局;UIPopovercontroller类不再支持箭头朝向的概念;现在支持内容呈现(presentation)朝向。UIColor对象提供的背景纹理已经不存在了。NSString中的许多功能已经过时,建议使用新的功能。

 

7.在libsyscall库中的gethostuuid方法已经过时。

 

iOS7以及之后的版本中,如果请求获取iOS设备的MAC地址,系统会返回02:00:00:00:00:00。如果需要唯一标示设备,使用UIDevice的identifierForVendor属性代替。(在程序中,如果需要自己的广告标示符,那么应该考虑使用ASIdentifierManager的advertisingIdentifier属性替代。)
关于过时API完整的列表,请看iOS 7.0 API Diffs。

posted @ 2013-06-16 02:04 小糊涂的超级blog 阅读(22) 评论(0) 编辑

 Case I. Simple Class

 Objective-C

 XE4 

// Protocol

@protocol mycalcEvent

- (void) oncalcEventA : (int) inx ext1:(int) extInx1;

- (void) oncalcEventB : (int) inx ext1:(int) extInx1;

@end

 

// ObjC Class : mycalc -------

@interface mycalc : NSObject {

    BOOL busy;

    //

    id <mycalcEvent> delegate;

}

 

- (void) setDelegate:(id) delegate;

- (int) calc : (int) value;

 

@property (nonatomicassignid delegate;

@end

  // User Protocol -----------------------------------------------

  mycalcEvent = interface(IObjectiveC)

   procedure oncalcEventA(inx :Integer; ext1 : Integer); cdecl;

   procedure oncalcEventB(inx :Integer; ext1 : Integer); cdecl;

  end;

 

  //

  TmycalcEvent = class(TOCLocal,mycalcEvent)

  private

  public

   procedure oncalcEventA(inx :Integer; ext1 : Integer); cdecl;

   procedure oncalcEventB(inx :Integer; ext1 : Integer); cdecl;

  end;

 

  // mycalc Class  --------------------------------------------

  mycalc = interface(NSObject)

   function  calc        ( value : integer) : integer; cdecl;

   procedure setDelegate ( adelegate : pointer ); cdecl;

  end;

 

  //

  MycalcClass  = interface(NSObjectClass) end;

  TMycalc = class(TOCGenericImport<MyCalcClass, mycalc>) end;

posted @ 2013-06-09 11:50 小糊涂的超级blog 阅读(12) 评论(0) 编辑

用Delphi XE4 开发的 24点游戏求解计算器. 终于 Ready for Sale 了. 

    The Answer of 24 Game 

虽然很简单,但是验证了Delphi XE4 开发应用到上线是没有问题的. 没有遇到私有API问题. 而且的确是很快速,延续了Delphi 一贯的特点. 稍微注意一下分辨率支持就好了. 

商店地址:  https://itunes.apple.com/us/app/answer-machine-puzzle-game/id647234514?ls=1&mt=8

用XE开发IOS是非常可能的.

 

 iAD用的就是韩国哥们的. 

posted @ 2013-06-07 09:28 小糊涂的超级blog 阅读(369) 评论(0) 编辑
太赞了这个. 如此也证实了 IOS 的 Framework的使用方式. 定义接口文件,就可以了. 要做的就是语法的转换问题. 
这个方法我也想过,还没有具体实施. 值得参考和扩展,其它的很多Framework 也是可以做到的. 当然还有bug// 离实际可用还有距离,
而我上次提交的App 苹果也给Reject 了. 貌似是分辨率不能支持得很好. - 是我的问题, 我用了一个WebVIew 但加载的页面没有适应ipad.
还有一个问题就是 我的应用太简单了. :) 等有时间再完善一下 再说.
  1     //
  2     // Delphi XE4 - iOS_Library_iAd
  3     //
  4     //  http://blog.naver.com/simonsayz
  5     //  Simon,Choi (최원식옹)
  6     //
  7     //  History
  8     //   2013.05.22 Ver 0.01  1st Release
  9     //
 10     //  Known Bug.
 11     //   - On Simulator, When press ad, Screen will be black.
 12     //     Why ?   Can't solved yet. 2013.05.22
 13     //
 14     //  Warning
 15     //   - This code is not perfect. Just guide to start to how to implement
 16     //
 17     //
 18     unit iOS_Library_iAd;
 19      
 20      
 21     interface
 22      
 23     uses Macapi.ObjectiveC,
 24          iOSapi.CocoaTypes, iOSapi.CoreGraphics, iOSapi.Foundation, iOSapi.UIKit;
 25      
 26     const
 27      libCoreiAd = '/System/Library/Frameworks/iAd.framework/iAd';
 28      
 29     Type
 30      id = Pointer;
 31      
 32      {$M+}
 33     { ADBannerView }
 34       ADBannerViewClass = interface(UIViewClass) end;
 35       ADBannerView      = interface(UIView)
 36         procedure setDelegate (newValue: id); cdecl;
 37         function delegate: id; cdecl;
 38         function isBannerLoaded: Boolean; cdecl;
 39         procedure setRequiredContentSizeIdentifiers (newValue: NSSet); cdecl;
 40         function requiredContentSizeIdentifiers: NSSet; cdecl;
 41         procedure setCurrentContentSizeIdentifier (newValue: NSString); cdecl;
 42         function currentContentSizeIdentifier: NSString; cdecl;
 43         {class} function sizeFromBannerContentSizeIdentifier
 44                          (contentSizeIdentifier: NSString): CGSize; cdecl;
 45         procedure setAdvertisingSection (newValue: NSString); cdecl;
 46         function advertisingSection: NSString; cdecl;
 47         function isBannerViewActionInProgress: Boolean; cdecl;
 48         procedure cancelBannerViewAction; cdecl;
 49       end;
 50      TADBannerView = class (TOCGenericImport<ADBannerViewClass,ADBannerView>) end;
 51      
 52      
 53     { ADBannerViewDelegate Protocol }
 54       ADBannerViewDelegate = interface(IObjectiveC)
 55         procedure bannerViewWillLoadAd(banner: ADBannerView); cdecl;
 56         procedure bannerViewDidLoadAd(banner: ADBannerView); cdecl;
 57         procedure bannerView(banner: ADBannerView; didFailToReceiveAdWithError: NSError); cdecl;
 58         function  bannerViewActionShouldBegin
 59                   (banner: ADBannerView; willLeaveApplication : Boolean): Boolean; cdecl;
 60         procedure bannerViewActionDidFinish(banner: ADBannerView); cdecl;
 61       end;
 62      
 63       //---------------------------------------------------------------------------
 64       TNotifyEvent        = Procedure (Sender : TObject) of Object;
 65       TNotifyMessageEvent = Procedure (Sender : TObject; Msg : String) of Object;
 66      
 67       //
 68       TADBannerViewDelegate = class(TOCLocal,ADBannerViewDelegate)
 69       Private
 70        FMe     : TObject;
 71        FOnLoad : TNotifyEvent;
 72        FOnFail : TNotifyEvent;
 73        FOnMsg  : TNotifyMessageEvent;
 74       public
 75        procedure bannerViewWillLoadAd(banner: ADBannerView); cdecl;
 76        procedure bannerViewDidLoadAd(banner: ADBannerView); cdecl;
 77        procedure bannerView(banner: ADBannerView; didFailToReceiveAdWithError: NSError); cdecl;
 78        function  bannerViewActionShouldBegin
 79                  (banner: ADBannerView; willLeaveApplication : Boolean): Boolean; cdecl;
 80        procedure bannerViewActionDidFinish(banner: ADBannerView); cdecl;
 81       end;
 82      
 83      //
 84      TiOSiAd = Class(TObject)
 85      Private
 86       //
 87       Function  GetOnLoad          : TNotifyEvent;
 88       Procedure SetOnLoad  ( Value : TNotifyEvent);
 89       Function  GetOnFail          : TNotifyEvent;
 90       Procedure SetOnFail  ( Value : TNotifyEvent);
 91       Function  GetOnMsg           : TNotifyMessageEvent;
 92       Procedure SetOnMsg   ( Value : TNotifyMessageEvent);
 93      Public
 94       FSelf    : TObject;
 95       FControl :  ADBannerView;
 96       FEvent   : TADBannerViewDelegate;
 97       //
 98       Constructor Create; Virtual;
 99       Destructor  Destroy; Override;
100       Procedure   Free;
101       //
102       Property  OnLoad : TNotifyEvent        Read GetOnLoad Write SetOnLoad;
103       Property  OnFail : TNotifyEvent        Read GetOnFail Write SetOnFail;
104       Property  OnMsg  : TNotifyMessageEvent REad GetOnMsg  Write SetOnMsg;
105      End;
106      
107     // exported string consts
108      
109     function ADErrorDomain: NSString;
110     function ADBannerContentSizeIdentifier320x50: NSString; // deprecated 'in iOS 4.2 and later';
111     function ADBannerContentSizeIdentifier480x32: NSString; // deprecated 'in iOS 4.2 and later';
112     function ADBannerContentSizeIdentifierPortrait: NSString;
113     function ADBannerContentSizeIdentifierLandscape: NSString;
114      
115     implementation
116      
117     uses
118       Posix.Dlfcn;
119     var
120       iAdModule: THandle;
121      
122     const
123       iAdFwk: string = '/System/Library/Frameworks/iAd.framework/iAd';
124      
125     function ADErrorDomain: NSString;
126      begin
127       Result := CocoaNSStringConst(iAdFwk, 'ADErrorDomain');
128      end;
129      
130     function ADBannerContentSizeIdentifier320x50: NSString;
131      begin
132       Result := CocoaNSStringConst(iAdFwk, 'ADBannerContentSizeIdentifier320x50');
133      end;
134      
135     function ADBannerContentSizeIdentifier480x32: NSString;
136      begin
137       Result := CocoaNSStringConst(iAdFwk, 'ADBannerContentSizeIdentifier480x32');
138      end;
139      
140     function ADBannerContentSizeIdentifierPortrait: NSString;
141      begin
142       Result := CocoaNSStringConst(iAdFwk, 'ADBannerContentSizeIdentifierPortrait');
143      end;
144      
145     function ADBannerContentSizeIdentifierLandscape: NSString;
146      begin
147       Result := CocoaNSStringConst(iAdFwk, 'ADBannerContentSizeIdentifierLandscape');
148      end;
149      
150     //------------------------------------------------------------------------------
151     //
152     //  iOSAd  := TiOSiAd.Create(nil);
153     //  iOSAd.Parent  := Self.View;
154     //
155     //------------------------------------------------------------------------------
156      
157     //
158     Procedure TADBannerViewDelegate.bannerViewWillLoadAd(banner: ADBannerView);
159      begin
160       if Assigned(FOnLoad) then FOnLoad(FMe);
161       if Assigned(FOnMsg ) then FOnMsg(FMe,'willLoadAd');
162      end;
163      
164     //
165     Procedure TADBannerViewDelegate.bannerView
166               (banner: ADBannerView; didFailToReceiveAdWithError: NSError);
167      begin
168       if Assigned(FOnFail) then FOnFail(FMe);
169       if Assigned(FOnMsg ) then FOnMsg(FMe,'didFailToReceiveAdWithError');
170      end;
171      
172     //
173     procedure TADBannerViewDelegate.bannerViewDidLoadAd(banner: ADBannerView); cdecl;
174      begin
175       if Assigned(FOnFail) then FOnFail(FMe);
176       if Assigned(FOnMsg ) then FOnMsg(FMe,'ViewDidLoadAd');
177      end;
178      
179     //
180     function  TADBannerViewDelegate.bannerViewActionShouldBegin
181     (banner: ADBannerView; willLeaveApplication : Boolean): Boolean; cdecl;
182      begin
183       if Assigned(FOnFail) then FOnFail(FMe);
184       if Assigned(FOnMsg ) then FOnMsg(FMe,'ActionShouldBegin');
185       Result := True;
186      end;
187      
188     //
189     procedure TADBannerViewDelegate.bannerViewActionDidFinish(banner: ADBannerView); cdecl;
190      begin
191       if Assigned(FOnFail) then FOnFail(FMe);
192       if Assigned(FOnMsg ) then FOnMsg(FMe,'ActionDidFinish');
193      end;
194      
195     //------------------------------------------------------------------------------
196      
197     //
198     Constructor TiOSiAd.Create;
199      begin
200       inherited;
201       // initialize --------------------------
202       FEvent         := TADBannerViewDelegate.Create;
203       FEvent.FOnLoad := nil;
204       FEvent.FOnFail := nil;
205       //
206       FControl :=  TADBannerView.Wrap( TADBannerView.OCClass.alloc);
207       FControl.initWithFrame( CGRectMake (0,480-20-50,320,50) );
208       FControl.setCurrentContentSizeIdentifier(ADBannerContentSizeIdentifierPortrait);
209       FControl.setDelegate(FEvent.GetObjectID);
210       //
211       FSelf := Self;
212      end;
213      
214     Destructor TiOSiAd.Destroy;
215      begin
216       //
217       FControl.release;
218       FControl := nil;
219       //
220       FEvent.Free;
221       FEvent   := nil;
222       //
223       inherited;
224      end;
225      
226     //
227     Procedure  TiOSiAd.Free;
228      begin
229             If Self <> nil then
230              Destroy;
231      end;
232      
233     //
234     Function  TiOSiAd.GetOnLoad : TNotifyEvent;
235      begin
236       Result := FEvent.FOnLoad;
237      end;
238      
239     //
240     Procedure TiOSiAd.SetOnLoad ( Value : TNotifyEvent );
241      begin
242       FEvent.FOnLoad := Value;
243      end;
244      
245     //
246     Function  TiOSiAd.GetOnFail : TNotifyEvent;
247      begin
248       Result := FEvent.FOnFail;
249      end;
250      
251     //
252     Procedure TiOSiAd.SetOnFail ( Value : TNotifyEvent );
253      begin
254       FEvent.FOnFail := Value;
255      end;
256      
257     //
258     Function  TiOSiAd.GetOnMsg : TNotifyMessageEvent;
259      begin
260       Result := FEvent.FOnMsg;
261      end;
262      
263     //
264     Procedure TiOSiAd.SetOnMsg ( Value : TNotifyMessageEvent );
265      begin
266       FEvent.FOnMsg := Value;
267      end;
268      
269     initialization
270       iAdModule := dlopen(MarshaledAString(libCoreiAd), RTLD_LAZY);
271      
272     finalization
273       dlclose(iAdModule);
274      
275     end.

只需要把上述两个文件保存以后 加入工程就可以了. 

 

 

posted @ 2013-05-23 12:53 小糊涂的超级blog 阅读(70) 评论(0) 编辑

Used in the Delphi Firemonkey Platform is very large, and is well organized. Of course Button, alone Firemonkey, and written.However, under certain circumstances in the OS the Native Control, because you will inevitably need to use a different API, about how to use the Native Control to learn.

//
//  XE4 & iOS Button Example
//
//   http://blog.naver.com/simonsayz
//
// Ref.
//   SampleNiblessApp  :  http://rvelthuis.de/zips/sampleniblessapp.7z
//   CCR.NSAlertHelper :  http://code.google.com/p/delphi-foundations/
//   Delegate Example  :  http://blogs.embarcadero.com/teamj/2013/05/09/3817/
//   XE2, Free Pascal  :  http://blog.naver.com/simonsayz/120162838290
//   Source to Html    :  http://www.duketown.com/marcel/hyperdelphi.shtml
//
unit Unit1;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.StdCtrls,
  FMX.Platform.iOS, FMX.Layouts, FMX.Memo,
  //
  System.TypInfo,
  Macapi.ObjectiveC,
  Macapi.ObjCRuntime,
  iOSapi.CocoaTypes,
  iOSapi.foundation,
  iOSapi.uikit,
  iOSapi.CoreGraphics;

type
  //
  IBtnDelegate = interface(NSObject)
   procedure BtnPressed; cdecl;
  end;
  //
  TBtnDelegate = class(TOCLocal)
  Private
   Finx   : Integer;
   FMemo  : TMemo;
  Public
   constructor Create( inx : integer; memo : TMemo );
   function  GetObjectiveCClass : PTypeInfo; override;
   procedure BtnPressed; cdecl;
  end;
  //
  TForm1 = class(TForm)
    Button1: TButton;
    Memo1: TMemo;
    procedure Button1Click(Sender: TObject);
  private
  public
   BtnDelegate : TBtnDelegate;
  end;

var
  Form1: TForm1;

implementation

{$R *.fmx}

Constructor TBtnDelegate.Create ( inx : integer; memo : TMemo );
 begin
  inherited Create;
  Self.Finx  := 10;
  Self.Fmemo := Memo;
 end;

function  TBtnDelegate.GetObjectiveCClass : PTypeInfo;
 begin
  Result := TypeInfo(IBtnDelegate);
 end;

//
procedure TBtnDelegate.BtnPressed;
 begin
  inc(Finx);
  FMemo.Lines.add('iOS Btn Pressed '+IntToStr(Finx));
 end;

//
procedure TForm1.Button1Click(Sender: TObject);
 Var
  Btn         : UIButton;
begin
 //
 Memo1.Lines.Add('FMX Btn Pressed');
 //
 Btn := TUIButton.Wrap( TUIButton.OCClass.buttonWithType(UIButtonTypeRoundedRect) );
 //
 Btn.setFrame ( CGRectMake(40,130,240,100) );
 Btn.setTitle (NSStr('iOS UIButton Pressed'),UIControlStateNormal);
 //
 BtnDelegate := TBtnDelegate.Create(10,Memo1);
 //
 Btn.addTarget( BtnDelegate.GetObjectID,       // target
                sel_getUid('BtnPressed'),      // action
                UIControlEventTouchDown);      // event
 //
 WindowHandleToPlatform(Self.Handle).View.addSubview(Btn);  //亮点啊!!!cnsoft mark

end;

end.
posted @ 2013-05-17 00:06 小糊涂的超级blog 阅读(86) 评论(0) 编辑
posted @ 2013-05-15 17:34 小糊涂的超级blog 阅读(24) 评论(0) 编辑
摘要: 思路是: GameCore 写游戏的核心逻辑. ProjectWeb 工程目录 引用上面的Module ProjectIos 同上. 平台相关的只在不同项目内进行. 尽量保持 GameCore 的纯洁.阅读全文
posted @ 2013-05-12 22:57 小糊涂的超级blog 阅读(28) 评论(0) 编辑
摘要: 其他常规流程是在 iTunes Connect里设置.这里讲的是附加的部分,是需要在用XE4 编译好了以后要做的. 要用到 Application Loader . 这个比较传统的流程. 现在在Mac上已经是用 Xcode 整合的功能来发布到 Appstore了.要登录:用开发者账号喔.然后选择 Delpoy your package. 如果iTunes connect 的 APP状态没有设置好, 不是 Wait for upload 的话 对话框里是看不到App的.要编译出一个 Appstore的发布版本, 还要设置好正确的 Provision 路径. Windows的上绝对路径.在Proj阅读全文
posted @ 2013-05-12 22:43 小糊涂的超级blog 阅读(112) 评论(4) 编辑
摘要: https://forums.codegear.com/message.jspa?messageID=561776#561776In this post, some guys are confused in this issue. Since i just have time to check the RAD Studio X4 during our laboray holiday , i have try to do some resarch on this issue. i almost resolve it . Because, i have a working Vmware machi阅读全文
posted @ 2013-05-12 22:27 小糊涂的超级blog 阅读(64) 评论(0) 编辑
摘要: Anexample of using an iOS API that we don’t wrapThe following very short snippet shows you how to set/clear the network activity indicator on iOS.uses iOSapi.UIKit;function SharedApplication: UIApplication;begin Result := TUIApplication.Wrap(TUIApplication.OCClass.sharedApplication);end;procedure ..阅读全文
posted @ 2013-05-11 02:36 小糊涂的超级blog 阅读(114) 评论(0) 编辑