我正在尝试更改后退按钮箭头
我目前正在使用以下内容来控制文本大小以及后退按钮上的文本颜色:
[[UIBarButtonItem appearance] setTitleTextAttributes:
[NSDictionary dictionaryWithObjectsAndKeys:
[UIColor whiteColor], UITextAttributeTextColor,
[UIFont boldSystemFontOfSize:16.0f], UITextAttributeFont,
[UIColor darkGrayColor], UITextAttributeTextShadowColor,
[NSValue valueWithCGSize:CGSizeMake(0.0, -1.0)], UITextAttributeTextShadowOffset,
nil] forState:UIControlStateNormal];
Run Code Online (Sandbox Code Playgroud)
但如果我只想改变后退按钮的箭头颜色,我该怎么办?
我正在研究一个iOS项目,该项目使用不同版本的coredata来处理迁移.
我还尝试在catch中包含if语句,并返回sqlite错误代码522.
这里有什么不对吗?
我的以下代码:
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator{
if (__persistentStoreCoordinator != nil) {
return __persistentStoreCoordinator;
}
NSURL *storeURL = [[self applicationDocumentsDirectory]
URLByAppendingPathComponent:@"coredatadb.sqlite"];
NSError *error = nil;
__persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption,
[NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];
if (![__persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:options error:&error]){
[[NSFileManager defaultManager] removeItemAtURL:storeURL error:nil];
[__persistentStoreCoordinator release];
__persistentStoreCoordinator = nil;
return [self persistentStoreCoordinator];
}
return __persistentStoreCoordinator;
Run Code Online (Sandbox Code Playgroud) 有没有人知道官方文档是否告诉我们iOS 8 iPad应用程序上标签栏的高度?
我的应用程序的标签栏框架是(0,719)(1024,49)在iOS 8上我的横向iPad应用程序.对于iOS 7,它是(0,712),(1024,56).
我在https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/TransitionGuide/Bars.html中读到,iOS 7 ipads的高度为56像素.我猜它与iOS 8不一样?
随着xcode 6的最新更改,看起来.app文件和文档文件夹不再位于iPhone模拟器目录中的同一文件夹中.
以前,我们可以访问目录和.app文件
/Users/me/Library/Application Support/iPhone Simulator/7.1/Applications/SomeCrpyticNumber
Run Code Online (Sandbox Code Playgroud)
但在Xcode 6中,模拟器目录完全不同:
~/Library/Developer/CoreSimulator/Devices/CrypticNumber1/data/Containers/Bundle/CrypticNumber2/MyApp.app
Run Code Online (Sandbox Code Playgroud)
和
~/Library/Developer/CoreSimulator/Devices/CrypticNumber1/data/Containers/Data/CrypticNumber3/Documents
Run Code Online (Sandbox Code Playgroud)
其中CryptNumber 1,2和3都是不同的.有没有办法在找到包含.app文件的文件夹后可以获取相应的Documents文件夹?我遇到了麻烦.
为什么...?
如果我在iOS 7模拟器上构建应用程序,则文档目录和.app文件至少与之前的文件夹位于同一文件夹中,但iOS 8将它们分开.
我现在能想到的唯一解决方案是配对2个具有最新创建/修改日期的文件夹.
编辑:
另外,这个工具对于在xcode 6上找到你的模拟器文件夹非常有用:http://simpholders.com/
我有一个程序设置一个警告对话框,询问"你想购买"TITLE"for"PRICE""
我知道Google IAB库有一个getSku()调用,但只有在购买该项目后才能使用.有没有办法在购买之前获得这两个变量?谢谢.
我可能已经看到一个查询一堆sku的项目,其中列出了所有项目,但我可能错了
我在A类中有以下代码:
UIViewController *vc = [self viewControllerForItem:item];
Run Code Online (Sandbox Code Playgroud)
我的app委托中的viewControllerForItem方法返回基于我的项目的UIViewController,即
vc = [[[MyCustomViewController alloc] init] autorelease];
return vc;
Run Code Online (Sandbox Code Playgroud)
然后我按下视图控制器:
[self.navigationController pushViewController:vc animated:YES];
Run Code Online (Sandbox Code Playgroud)
我试图推送的这个VC是一个MKMapView,我在dealloc方法中插入一个日志语句来查看它是否被调用.在我的内存使用中,增长速度非常快.
但是,当我在推送VC后添加以下代码时:
[vc release];
Run Code Online (Sandbox Code Playgroud)
我的MKMapView类调用dealloc方法.
当然,如果MKMapView类是我的app委托返回的唯一类(或者我可以检查VC的类是否是我的MKMapView类),这将是一个简单的解决方案.但是,我想解决这个根本问题.
如果我在视图控制器上设置autorelease,为什么不调用dealloc?
即使在该vc上使用autorelease,我怎么可能将[vc release]添加到视图控制器?
谢谢
编辑:
这是一些额外的信息.我的app委托中有viewControllerForItem类.我将自动释放的对象返回到我的其他管理器类中,然后我推送视图控制器.当我返回一个自动释放的对象时,保留计数是否被搞砸了,然后在其他类中推送它?
当我推送VC并调用mkmapview的didDissappear时,这就是backtrace/callstack:
pushVC: (
0 NewHampshire 0x00254cdf -[CustomViewController navigateToRowId:withLinkBehavior:animated:] + 2111
1 NewHampshire 0x002534c9 -[CustomViewController webView:shouldStartLoadWithRequest:navigationType:] + 841
2 UIKit 0x02caf288 -[UIWebView webView:decidePolicyForNavigationAction:request:frame:decisionListener:] + 318
3 UIKit 0x02cb1854 -[UIWebViewWebViewDelegate webView:decidePolicyForNavigationAction:request:frame:decisionListener:] + 77
4 CoreFoundation 0x05d0bd1d __invoking___ + 29
5 CoreFoundation 0x05d0bc2a -[NSInvocation invoke] + 362
6 CoreFoundation 0x05d0bdaa -[NSInvocation invokeWithTarget:] …
Run Code Online (Sandbox Code Playgroud) memory-leaks memory-management objective-c uiviewcontroller ios
目前,我通过以下方式请求Instagram的OAuth获取访问令牌:
//Create OAuth
NSString *oAuthURL = [NSString stringWithFormat:@"https://api.instagram.com/oauth/authorize/?client_id=%@&redirect_uri=%@&response_type=token", instagramID, instagramRedirectUri];
self.authWebView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 64.0f, self.view.frame.size.width, self.view.frame.size.height)];
NSURL *url = [NSURL URLWithString:oAuthURL];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
[self.authWebView loadRequest:requestObj];
self.authWebView.delegate = self;
[self.view addSubview:self.authWebView];
Run Code Online (Sandbox Code Playgroud)
但是,我希望能够将本机Instagram应用程序(如果可用)启动到类似facebook app的单点登录.这可能吗?如果Instagram应用程序只是请求权限并且用户按下ok而不是填写他们的凭据,那将是非常酷的.
谢谢.
我正在开发用于iOS应用程序的Verifone E315 POS,我已经厌倦了拔出设备并直接插入我的iOS设备以查看堆栈跟踪.
有没有人知道是否有可能购买闪电到微型USB适配器,将其插入E315的侧面并在我的iOS设备插入雪橇时进行调试?
谢谢
我有一个构建服务器来检查我的xcode项目,但有几个问题.如果结帐发生,我需要构建应用程序,但我不提交.xcworkspace文件,因为不止一个人在项目上工作.
我在项目目录中的终端中运行以下代码:
sudo xcodebuild -configuration Debug
Run Code Online (Sandbox Code Playgroud)
它最终因错误而失败:
Code Sign error: Provisioning profile '7DXXX-XXXX-XXXX....' can't be found
Run Code Online (Sandbox Code Playgroud)
我打开了我的目录:
~/Library/MobileDevice/Provisioning\Profiles/
Run Code Online (Sandbox Code Playgroud)
配置文件肯定存在,证书是正确的,我的调试版本不编码符号.
有什么想法吗?谢谢.
如果我运行自定义构建并将其中一个标志设置为true,我正在使用TeamCity构建步骤将某个构建标记为SVN.
但是,在完成此构建之后,我想自动化TeamCity来固定刚刚创建的自定义构建.这可能吗?我已经了解了REST API,但我不确定它是否是解决方案.
我目前有以下代码
while (!visibleTiles.isEmpty())) {
tile = visibleTiles.keySet().iterator().next();
if (tile != null){
bitmap = visibleTiles.remove(tile);
if(bitmap != null && !containsKey(tile)){ //safe to recycle if tile cache is not actively holding it
bitmap.recycle();
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是,我在网上遇到了NoSuchElementException崩溃
tile = visibleTiles.keySet().iterator().next();
Run Code Online (Sandbox Code Playgroud)
使用isEmpty()方法和调用hasNext()调用有很大区别吗?我知道哈希图没有hasNext()调用,所以我做了以下工作:
while (visibleTiles.keySet().iterator().hasNext()) {
tile = visibleTiles.keySet().iterator().next();
if (tile != null){
bitmap = visibleTiles.remove(tile);
if(bitmap != null && !containsKey(tile)){ //safe to recycle if tile cache is not actively holding it
bitmap.recycle();
}
}
}
Run Code Online (Sandbox Code Playgroud)
显然,我知道我应该只运行该应用程序,看看它是否崩溃,但是问题是很难重现该问题。
谢谢!
我有一个带缩略图的垂直滚动视图,作为ipad应用程序上特定项目的"侧面板".
这是我设置内容大小的代码:
- (void)setScrollViewContentSize:(UIScrollView*)scrollView{
NSInteger viewCount = [scrollView.subviews count];
NSLog(@"viewCount: %d", viewCount);
NSLog(@"height: %f", (viewCount * 190.0f));
scrollView.contentSize = CGSizeMake( scrollView.superview.frame.size.width, (viewCount * 190.0f));
}
Run Code Online (Sandbox Code Playgroud)
当我运行我的应用程序时,有一个菜单有57个项目,因此viewCount日志显示为57,高度显示为10830.在另一个菜单上,我有13个项目,因此,高度为2470.
这里的一切看起来都很好,但是当我滚动到视图的末尾时,带有57个图标的菜单会留下太多的空白区域,而带有13个项目的菜单会在最后一个项目上完美地结束并略有余量(每个缩略图为183px) ).我试图找出原因是什么,但似乎我拥有的菜单项越多,滚动视图在最后一项上的间距就越大.
我尝试调用scrollView sizeToFit,甚至尝试创建一个可见区域的CGRect到我的框架的苹果,但没有一个工作.有任何想法吗?
谢谢.
ios ×9
objective-c ×3
android ×2
ios8 ×2
xcode ×2
core-data ×1
facebook ×1
hashmap ×1
instagram ×1
ios6 ×1
ios7 ×1
iphone ×1
iterator ×1
java ×1
memory-leaks ×1
oauth ×1
scrollview ×1
tabbar ×1
teamcity ×1
uiscrollview ×1
verifone ×1
xcode6 ×1
xcodebuild ×1