objective-c

Objective C adding a tab bar item to change to other views

Hi, I Have a normal view based application and have added an UITabBar component. I have found help how to create a tabbar app but nothing about how to use the UITabbar item separately How may I use this to switch views please? ...

OCUnit tests not running / not being found

I'm trying to get to grips with OCTest, but can't seem to get it to actually run my tests (at least, I believe it's not running my tests). I've set up a project as described in the developer documentation, and added a class called UnitTests which contains the following function: -(void)testFailures { STFail(@"A message"); } When I...

iPhoneOS, using applicationWillResignActive

Hi Everybody, I want to use this function applicationWillResignActive perform some tasks. before the application shuts down due to incoming call, message or user close it manually. Can i send an email message/in app sms using this function ? Will those tasks would be performed or the application would immediately quit due to the above ...

Read plist data into a NSArray but get null

I got same warning here “local declaration hides instance variable” warning but I got more problems... Here is my code - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.someaddress.php"] cach...

NSBundle returns nil

Hi, I wanted to read version information of my application from the plit file. For this I am using a code as shown below. NSString *myFilePath = [[NSBundle mainBundle] pathForResource:@"MyApp-Info" ofType:@"plist"]; // Format output NSLog(@"%@",myFilePa...

Constraining a back wheel to the front wheel

Hopefully I can describe my situation clearly as whenever I try to describe it to others on the whiteboard or pen and paper it takes a few attempts :) Part of my program involves a cart that rides along a rail and the cart runs on two wheels. The rails is a simple line which hills up and down in curves and also flattens out. To create t...

How to control master volume with MPVolumeView

im using MPVolumeView for controlling master volume. When i change the volumeview slider it will not affect to the ringer volume. But the strange thing is while open any another application, ringer volume changes will affect there. what is the reason for that? Why the changes is not affecting immedietly? Any insight is appreciated! ...

The current way to release memory from a UIScrollview with many images

Dear Scholars. I am generating a simple scrollView with some images attached to buttons. This works fine apart from the fact that this scroll view is taking rather much memory. Since this scrollView is just a sub Menu allowing the user to pick an image and soon after I do not need it, I would like to free this heavy block from memory. ...

Objective-C: How to solve a system of equations?

I need to write an app in Obj-C which solves systems of linear equations (the equations are entered by the user). What is the algorithm for this? Thanks in advance! ...

calling functions between two different classes

hi all, i've got a small scenario to call fucntions in two different classes. i have two classes names firstClass.m and secondClass.m i want to call class1.m from class2.m secondClass method { variables 1 & 2; call method in class1 } firstClass method { NSLog("printing variables 1 & 2 of secondClass.m"); } i want to knw h...

Strange behavior with NSObject Properties...

I have an NSObject that I am using to store/hold properties of an object, one of them being a "Name" property cast as an NSString. I am also pulling data from a SQLite DB for said object using the following: - (void) getDataToDisplay:(NSString *)dbPath { if (sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK) { NSSt...

How can I get one of my Preference Specifiers in the Settings Bundle to default to YES?

I've got a weird one when I test on the iPhone... I have a settings.bundle that has a Boolean for background_sounds which is set to YES by default. The problem is, when the app loads first time, the background_sounds pref seems to be set to NO when checked. I've tried synchronizing NSUserDefaults and everything, but the only way of makin...

Converting int, double to char array in C or Objective C

I want to convert int to char array and double to char array. Any way of doing this in C or Objective C. ...

how to extract from two delimiter.

1+2+3:4+5+6:7+8+9 How to delimit if i have two delimiter + and : and i am using array to store myarray1 = [myarray2 componentsSeparatedByString:@":"]; delimit only : ...

iPhone AVAudioPlayer - play WHILE clicking, stop on lift of finger

Hi, I am using AVAudioPlayer and am trying to get it so while the user presses on the device, it continuously plays until their finger lifts up. My code is below: NSString *audioPath = [[NSBundle mainBundle] pathForResource:@"HahahaLong" ofType:@"mp3"]; primaryAudio = [[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPa...

popViewController doesnt seem to work with UIView animations

Hello I have the following code, which does a nice animation when pushing a new view controller. [UIView beginAnimations:@"animation" context:nil]; [UIView setAnimationDuration:0.5]; [[self navigationController] pushViewController:details animated:NO]; [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.na...

How to change all the strings in an iphone application with respective selected language in settings?

Hi Guys, I need help from you, I need to display all the text, labels , strings and what ever text is showing to user in the iphone application with respective selected language in settings of iphone. for example user selects German or French in settings of iPhone language, then my application should provide or view the details in that...

How to compare array element?

Suppose I have an array having elements "am","john","rosa","freedom". I want to compare these elements and result would be the word and the size of the longest word. I am using objective C. ...

Determine kernel bitness in Mac OS X 10.6

I know that I can use the terminal and the system-profiler command to determine the current bitness of the kernel but I am trying to determine if there is a way to get that same information programmatically in objective-c. I have looked through Carbon's gestalt, but haven't seen anything that would tell me bitness of the kernel. Does a...

Get notified when something is added to NSPasteboard

In my application I want to get notified if something is added into the NSPasteboard. If I copy an text from any other program I want my application to know about it. Somewhere I read it can't be done that way. I should create a timer and check the content of the NSPasteboard myself. Is this the way to do? Or are there any kind of not...