xcode4.5

Strange crash when I try to access to uibutton's titleLabel property (xcode 4.5 and IOS sdk 6.0)

孤者浪人 提交于 2019-12-25 15:25:00
问题 I found another annoying bug with xcode 4.5 and sdk 6.0 : when I run the following code : UIColor *newcolor = [UIColor colorWithCIColor:[CIColor colorWithString:@"1 1 1 1"]]; [button setTitleColor:newcolor forState:UIControlStateNormal]; UILabel *lbl = selectedbutton.titleLabel; It always fail with the error : -[UICIColor colorSpaceName]: unrecognized selector sent to instance 0xa9864f0 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UICIColor

Strange crash when I try to access to uibutton's titleLabel property (xcode 4.5 and IOS sdk 6.0)

感情迁移 提交于 2019-12-25 15:24:41
问题 I found another annoying bug with xcode 4.5 and sdk 6.0 : when I run the following code : UIColor *newcolor = [UIColor colorWithCIColor:[CIColor colorWithString:@"1 1 1 1"]]; [button setTitleColor:newcolor forState:UIControlStateNormal]; UILabel *lbl = selectedbutton.titleLabel; It always fail with the error : -[UICIColor colorSpaceName]: unrecognized selector sent to instance 0xa9864f0 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UICIColor

UIScrollView when Autolayout is turned on (StoryBoard)

杀马特。学长 韩版系。学妹 提交于 2019-12-25 06:20:50
问题 I was wrestling with UIScrollview and it knocked me out. I tried to take reference from following two post on stackOverFlow scrollview xcode4.5 autolayout, Xcode 4.5 UIScrollView, Embed ImageView in ScrollView with Auto Layout on iOS 6, I tried viewDidLayoutSubviews, as told in UIScrollView setContentSize breaks view with Auto Layout that is causing my app to crash. And I tried ViewDidLoad, viewDidAppear and viewWillAppear but nothing worked. I tried google and found couple more related post

Changing DetailViewController on btn click in RootViewController fails on iOS6 in iPad Portrait Orientation

女生的网名这么多〃 提交于 2019-12-25 00:14:50
问题 I am porting my App from iOS3.2 to iOS6. On iPad, I use the SplitViewController. In the RootViewController, I have got a table view. If the user clicks on a row in the table view, I change the DetailViewController. The code doing this is: - (void)setDetailViewAuthorPage { UISplitViewController *splitViewController = (UISplitViewController *)self.parentViewController.parentViewController; UIViewController *detail = [splitViewController.viewControllers objectAtIndex:1];

Locking Interface Orientation?

六月ゝ 毕业季﹏ 提交于 2019-12-25 00:14:31
问题 On the initial view of my app I want the interface to be portrait only but on the view controllers after that it can be any orientation. I tried this code to lock it but it doesn't work and the view can still rotate: - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait); } 回答1: The reason that code is not working is most likely because you are running iOS 6. Try this code instead: - (BOOL

Limit the app working on iPhone5 only?

寵の児 提交于 2019-12-24 02:00:48
问题 I googled about it but didn't came to any conclusion : Can I limit my app to work only for iPhone5 device? **May be something like this in .plist file ** or any other API <key>UIRequiredDeviceCapabilities</key> <array> <string>iPhone5</string> </array> Anyhow, if this is achievable then can I bypass through app store approval process ? Since upto my knowledge, it may show the MetaData error if I don't upload the screenshots for iPhone4/4S. So, simply I would like to have my app running on

ios 6 uiwebview shows background while scrolling a page using jquery scrolltop

倖福魔咒の 提交于 2019-12-24 00:31:38
问题 I have a web page being displayed in a UIWebView that uses jquery scrollTop (using 1.6.4 version of jquery) to scroll the window to a speicified position after the page is loaded. This was working fine with xcode older than 4.5. After I built it using xcode 4.5 the page momentarily shows the background of the UIWebView before scrolling. This happens only in ios6. Has anyone encountered any similar issue with xcode 4.5 and ios6? Is there any new API for UIWebview that I can use to stop this

pushing UIViewController without Navigation Controller

本小妞迷上赌 提交于 2019-12-23 21:15:49
问题 I was using that method for pushing another UIViewController in if condition : initViewController *MW = [initViewController alloc]; MW = [self.storyboard instantiateViewControllerWithIdentifier:@"init"]; [self.navigationController pushViewController:MW animated:YES]; Now i've changed my architecture and i just removed my Navigation controller. That's why , these steps will not help me any longer due to no NavigationController exist. Now how can i push another ViewController without pressing

Return tag of the label when it it tapped

Deadly 提交于 2019-12-23 05:07:51
问题 I have 5 labels in my view, respectively tagged 1, 2, 3, 4 and 5. I have enabled user interaction on them, and added a tap gesture. Now what I want is to get the tag of the label being touched. I am doing something like this: tapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapGestureSelector)]; tapGesture.numberOfTapsRequired = 1.0; - (void)tapGestureSelector :(id)sender { // I need the tag to perform different tasks. // So that I would like to get the touched

Return tag of the label when it it tapped

痴心易碎 提交于 2019-12-23 05:07:12
问题 I have 5 labels in my view, respectively tagged 1, 2, 3, 4 and 5. I have enabled user interaction on them, and added a tap gesture. Now what I want is to get the tag of the label being touched. I am doing something like this: tapGesture=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapGestureSelector)]; tapGesture.numberOfTapsRequired = 1.0; - (void)tapGestureSelector :(id)sender { // I need the tag to perform different tasks. // So that I would like to get the touched