我一直在摸着plist标识符:
UIUpgradeOtherBundleIdentifier
...这可能正是我正在寻找的处理一些捆绑标识符问题...但在提交之前希望它可以工作,我真的很想知道它究竟做了什么.但我找不到任何文件.
谁知道这是做什么的?或者甚至更好,使用它,或者有文档吗?
虚拟派和拥抱将有:]
我刚刚彻底检查了我的代码库以使用新的facebook-ios-sdk 3.0(来自之前的版本,2.x或whatnot).
一切都运行良好,直到我意识到我没有考虑已经授予应用程序权限/使用之前的SDK实现登录的用户.所以我尝试检查是否在NSUserDefaults中保存了accessToken,如果是,请拨打电话打开会话:
if ([[NSUserDefaults standardUserDefaults] objectForKey:@"FBAccessTokenKey"] &&
[[NSUserDefaults standardUserDefaults] objectForKey:@"FBExpirationDateKey"]) {
[FBSession openActiveSessionWithPermissions:permissions
allowLoginUI:allowLoginUI
completionHandler:^(FBSession *session,
FBSessionState status,
NSError *error) {
// deal with state change
}
Run Code Online (Sandbox Code Playgroud)
我的假设是用户不必为SSO快速切换应用程序,因为他们已经有了.然而,确实会发生这种情况.
我宁愿不让每个现有用户在升级时都需要重新登录.
有没有人成功升级而无需重新登录?
谢谢
migration authentication objective-c access-token facebook-ios-sdk
我是Objective-C编程的新手.
我想通过邮政编码/邮政编码在MapView中显示位置.为此,我必须找到纬度和经度.
我已经通过将zip代码传递给Web服务并获得所有信息的响应来引用了许多解决方案.
但我不想使用任何网络服务.我想通过使用CLGeocoder来做到这一点
我正在使用下面的代码来查找纬度经度.
-(IBAction)fetchCoordinates:(id)sender {
if (!self.geocoder) {
self.geocoder = [[CLGeocoder alloc] init];
}
NSString *address = [NSString stringWithFormat:@"%@ %@ %@", self.streetField.text, self.cityField.text, self.countryField.text];
[self.geocoder geocodeAddressString:address completionHandler:^(NSArray *placemarks, NSError *error) {
NSLog(@"mark :: %@", placemarks);
if ([placemarks count] > 0) {
CLPlacemark *placemark = [placemarks objectAtIndex:0];
CLLocation *location = placemark.location;
CLLocationCoordinate2D coordinate = location.coordinate;
self.coordinatesLabel.text = [NSString stringWithFormat:@"%f, %f", coordinate.latitude, coordinate.longitude];
if ([placemark.areasOfInterest count] > 0) {
self.nameLabel.text = [placemark.areasOfInterest objectAtIndex:0];
} else {
self.nameLabel.text …Run Code Online (Sandbox Code Playgroud) 我一直在努力处理我的iPhone应用程序的位置服务请求.如果用户说"不允许",我就会陷入"我的应用需要位置服务以便工作"...
所有重新申请位置服务的尝试都没有结果,这里有几个堆栈可以证明.
然后我读到重新启用位置服务的唯一方法是使用以下方法将用户重定向到位置服务设置:
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"prefs:root=LOCATION_SERVICES"]];
Run Code Online (Sandbox Code Playgroud)
但即使这似乎也不起作用(iPhone 4和4S,均为5.1)
除了告诉用户去偏好然后引导他通过之外,真的没有别的办法吗?对我来说,这似乎很笨拙.
iphone objective-c core-location permission-denied cllocationmanager
我有一个phonegap应用程序,我试图实现Admob.
我正在使用phonegap 1.4.1版,我使用这个网站作为参考:http://iphone.keyvisuals.com/iphonedev/implementing-admob-ads-in-a-phonegap-project-for-ios-no -plugins要求的/
我的代码如下:
(void)webViewDidFinishLoad:(UIWebView *)theWebView
{
bannerView_ = [[GADBannerView alloc]init];
[bannerView_ setDelegate:self];
[bannerView_ setFrame:CGRectMake(0, 0, 320, 50)];
// Specify the ad's "unit identifier." This is your AdMob Publisher ID.
bannerView_.adUnitID = MY_BANNER_UNIT_ID;
// Let the runtime know which UIViewController to restore after taking
// the user wherever the ad goes and add it to the view hierarchy.
bannerView_.rootViewController = self.viewController;
[self.viewController.view addSubview:bannerView_];
// Initiate a generic request to load it with an ad.
[bannerView_ loadRequest:[GADRequest …Run Code Online (Sandbox Code Playgroud) 是否可以关闭自动旋转的动画?我想让它旋转,但我只是不想要动画发生(就像一个即时开关).
XCode 4(我使用4.3.3)具有很好的功能 - 在大多数导航器面板(左侧面板)的底部,它有搜索字段,您可以在其中将匹配表达式写入您需要的快速查找实体.但我没有找到任何方法从代码区切换到此字段而不使用鼠标/触控板.
有人知道在Preferences-> Key Bindings中调用的快捷方式吗?
我是否可以从不同的国家/地区注册Apple开发者计划,因为Apple在线商店在我的国家/地区不可用,其他人可以为我的帐户付款吗?
我正在寻找一种用CSS定位特定图像的方法,如果可能的话.
我正在运行CMS,用户可以上传图像并将其放在页面上.我想要一种方法来定位具有特定尺寸的图像.
所以问题是,你能用css线来定位具有一定尺寸规格的图像或物体吗?
我会想象:
img#width:400px { float :left; }
Run Code Online (Sandbox Code Playgroud)
(制作400像素宽的图像有浮动:左)
我知道我可以给图像一个类或一个id,但是当客户在cms中玩游戏时它会丢失.
在JSON解析期间(使用AFNetwork json getter完成),我有这段代码:
if (![[data class] isKindOfClass:[NSDictionary class]]) {
DLog(@"%@ was not kind of class NSDictionary",[data class]);
return;
}
Run Code Online (Sandbox Code Playgroud)
但由于某些原因,If句子变为真,函数返回:
> __NSCFDictionary was not kind of class NSDictionary
Run Code Online (Sandbox Code Playgroud)
但是不应该__NSCFDictionary是专门的一类NSDictionary?或者如果这是错误的验证方式,我该怎么做?
我尝试过它,就像这样:
if (![[NSDictionary class] isKindOfClass:[data class]]) {
DLog(@"%@ was not kind of class NSDictionary",[data class]);
return;
}
Run Code Online (Sandbox Code Playgroud)
仍然不起作用:
__NSCFDictionary不是类NSDictionary
iphone ×7
objective-c ×4
ios ×2
xcode ×2
access-token ×1
admob ×1
animation ×1
app-store ×1
autorotate ×1
clgeocoder ×1
cordova ×1
css ×1
dimensions ×1
image ×1
ipad ×1
json ×1
location ×1
migration ×1
nsdictionary ×1
rotation ×1
targeting ×1
xcode4 ×1