Tag: iphone

How do I convert a hex color in an NSString to three separate rgb ints in Objective C?

I may be making something incredibly simple incredibly complicated, but nothing I’ve tried so far seems to work. I have NSStrings like @”BD8F60″ and I would like to turn them into ints like: r = 189, g = 143, b = 96. Have found ways to convert hex values that are already ints into rgb […]

Probelem with NSTimer

I have a problem with a NSTimer. I received a “SIGABRT” error and [NSCFTimer intValue]: unrecognized selector sent to instance These is my code: -(void)detectionMove:(NSNumber*)arrayIndex{ static BOOL notFind = FALSE; static int countVariable = 0; static int countRilevamenti = 0; notFind = FALSE; for(int i = countVariable+1; i<[[[[sharedController arrayMovement]objectAtIndex:[arrayIndex intValue]] arrayPositionMove]count]; i++){ if(!notFind){ if((actualAccelerometerX+sensibilityMovement) >= […]

Xcode 4.2.1 issue : Universal app runs on iPad but not on iphone

I am right now working on one universal application where I am stuck to one point. I was able to successfully launch my application both on iPhone and iPad but since 2-3 days, I am not able to launch my application on neither iPhone nor iPhone simulator but it runs smoothly on iPad/ipad simulator. Also […]

App freezes on main thread on iPhone 5c but not on iPhone 6s

I’m working on an app with a navigation controller. Swift + objective C Important note: This freeze happens 100% when testing on iPhone 5c and never happens when testing on iPhone 6s The scenario is: Go to TableViewController A Touch an item of the list to reach TableViewController B Go back to TVController A by […]

how to stop performing selector in background?

I have some class A. In this class i have a method, which calls [self performSelectorInBackground:…]. And it starts downloading some info from internet. After i tap Home button, then enter the app again, this background method keeps working. So, if i call this method again, i have bad_access, because background method is already working […]

EXC_BAD_ACCESS after converting HTTP response to string

I have the following code, from which I am getting an EXC_BAD_ACCESS error: – (void)connectionDidFinishLoading:(NSURLConnection *)connection { NSString *responseString = [[NSString alloc] initWithData:receivedData encoding:NSUTF8StringEncoding]; NSLog(responseString); } The weird thing is, the bad access error is actually coming from the NSLog() line, when it tries to access responseString. I’ve even tried adding a retain or autorelease […]

how can I set substring of a NSString as bold in UILabel

Possible Duplicate: Bold & Non-Bold Text In A Single UILabel? I want to know that how can I set substring of a NSString as bold in UILabel ? for example : I have a string in UILabel say, *Apply to a bill of $16 or more and I want to make ” $16 ” bold […]

Custom background on UITabBarItem not set on second tap

I have a custom tabbar with custom tabbar items. Everything works as I want it to, besides when a tap has been tapped and is in a selected state, it does not use my custom highlighted background if re-tapped. So far I set: UIButton *tap = [UIButton buttonWithType:UIButtonTypeCustom]; [tap setBackgroundImage:img forState:UIControlStateNormal]; [tap setBackgroundImage:[UIImage imageNamed:@”img_down”] forState:UIControlStateHighlighted]; […]

Changing the title of a MFMailComposeViewController

Although i know changing MFMailComposeViewController is fround upon, i’m taking a risk. I found some ideas such as [self presentModalViewController:controller animated:YES]; // Existing line [[[[controller viewControllers] lastObject] navigationItem] setTitle:@”SomethingElse”]; and [[[[(MFMailComposeViewController*)vc navigationBar] items] objectAtIndex:0] setTitle:@” SomethingElse”]; but the odd thing is that the title is “SomethingElse” for like 2 seconds and after that it returns […]

RSSI value in gamekit iphone api

Is it possible to get bluetooth RSSI (Radio signal strength) value in gamekit iphone api? If it is pssobile, can i have some sample code. If it is not possible is there any other way to get bluetooth RSSI value in iphone OS 3.0?