对于以前的iOS测试版8,负荷(束)本地web应用程序,它都为正常工作UIWebView
和WKWebView
,我甚至移植使用新的网页游戏WKWebView
API.
var url = NSURL(fileURLWithPath:NSBundle.mainBundle().pathForResource("car", ofType:"html"))
webView = WKWebView(frame:view.frame)
webView!.loadRequest(NSURLRequest(URL:url))
view.addSubview(webView)
Run Code Online (Sandbox Code Playgroud)
但在测试版4中,我只是得到了一个空白的白色屏幕(UIWebView
仍在工作),看起来没有任何内容被加载或执行.我在日志中看到一个错误:
无法为其创建沙箱扩展 /
有没有帮助引导我走向正确的方向?谢谢!
用于合成属性的属性: retain/assign
所有权属性: IOS5 =强/弱IOS4 = retain/unsafe_unretained
强大(iOS4 =保留) - 我是主人,你不能解除这个,然后瞄准罚款=保留
weak(iOS4 = unsafe_unretained) - 与assign,no retain或release相同
所以unsafe_unretained == assign?
@property (nonatomic, assign) NSArray * tmp;
Run Code Online (Sandbox Code Playgroud)
等于?
@property (nonatomic, unsafe_unretained) NSArray * tmp;
Run Code Online (Sandbox Code Playgroud)
反之亦然?
如果是这样,在iOS4中哪一个更喜欢,或者为什么(unsafe_unretained)如果它与assign完全相同?
并且iOS4中的委托应该是unsafe_unretained还是分配?
我想使用IB在单独的.xib中创建自定义标题部分视图
但是在IB中我找不到组件UITableViewHeaderFooterView(类似于UITableViewCell)并为其分配重用
那么如何在自定义标题部分创建?
我创建了一个继承自UITableViewHeaderFooterView的MySection类创建.xib,MySection.xib注册xib以便重用单元格
问题是,如何使用initWitReuseIdentifier ....
我相信这是一个常见的问题,许多答案不再适用,很多只是部分,如果你在iOS7下,你的iPad应用程序只是Landscape,但你想使用UIImagePickerController
with source UIImagePickerControllerSourceTypePhotoLibrary
或UIImagePickerControllerSourceTypeCamera
.
如何设置正确,所以它100%工作?并且您没有获得混合方向并避免错误"支持的方向与应用程序没有共同的方向,并shouldAutorotate
返回YES
".
cocoa-touch uiimagepickercontroller ipad uiinterfaceorientation ios
如何在新的itunes连接中找到崩溃日志?关于apple的文档,指的是旧的itunes connect,但在新版本中无法找到它
此错误没有意义,因为UIInterfaceOrientationLandscapeRight
支持的方向返回首选方向
//iOS6
-(BOOL)shouldAutorotate
{
return NO;
}
-(NSUInteger)supportedInterfaceOrientations
{
return (UIInterfaceOrientationLandscapeRight | UIInterfaceOrientationLandscapeLeft);
}
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
return UIInterfaceOrientationLandscapeRight;
}
Run Code Online (Sandbox Code Playgroud)
错误:
由于未捕获的异常'UIApplicationInvalidInterfaceOrientation'而终止应用程序,原因是:'preferredInterfaceOrientationForPresentation必须返回支持的接口方向!'
第一次启动UIRefreshControl时文本被错误地反映...稍后有时刷新文本根本没有出现,只有刺状是可见的
我不认为我对iOS6有这个问题...可能与iOS7有关
在UITableViewController中作为子项添加到VC中,它驻留在一个模态呈现的UINavigationController中
- (void)viewDidLoad {
[super viewDidLoad];
[self setRefreshControlText:@"Getting registration data"];
[self.refreshControl beginRefreshing];
}
- (void)setRefreshControlText:(NSString *)text {
UIFont * font = [UIFont fontWithName:@"Helvetica-Light" size:10.0];
NSDictionary *attributes = @{NSFontAttributeName:font, NSForegroundColorAttributeName : [UIColor blackColor]};
self.refreshControl.attributedTitle = [[NSAttributedString alloc] initWithString:text attributes:attributes];
}
Run Code Online (Sandbox Code Playgroud)
我正在使用最新的崩解剂获取此警告,如何摆脱它们以及它们的含义是什么?
[Crashlytics] Version 3.3.1 (79)
[Crashlytics:Crash] Warning: iOS 9 workaround for binary image loading issue in place.
Run Code Online (Sandbox Code Playgroud) 我的应用中的用户可以使用2种服务登录:Facebook或Google
一切正常,但是,在:
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation: (id)annotation {
...
}
Run Code Online (Sandbox Code Playgroud)
我应该决定拨打Facebook回拨或Google回调
如果用户有应用程序,它很容易,比我的sourceApplication决定,但当没有(没有本地Facebook帐户链接,没有FB应用程序,没有GooglePlus应用程序),它链接到浏览器:(我不知道它是否是来自Facebook或谷歌
有什么方法可以决定叫什么?喜欢
- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation: (id)annotation {
// how to decide?
if (facebook) {
return [FBSession.activeSession handleOpenURL:url];
} else if (google) {
return [GPPURLHandler handleURL:url sourceApplication:sourceApplication annotation:annotation];
}
}
Run Code Online (Sandbox Code Playgroud) 如何将UITextRange
对象转换为NSRange
?我已经看到很多关于走向另一个方向的SO帖子,但这与我需要的相反.我正在使用的UITextRange
selectedTextRange
是一个属性UITextView
.它返回一个,UITextRange
但我需要一个范围.
ios ×6
cocoa-touch ×5
cocoa ×2
objective-c ×2
uitableview ×2
crashlytics ×1
facebook ×1
ios6 ×1
ios7 ×1
ios8 ×1
ipad ×1
nsrange ×1
oauth-2.0 ×1
swift ×1
uitextrange ×1
wkwebview ×1