iphone-sdk-3.0

NSMutableDictionary of NSMutableSets... sorting this out

I have a NSMutableDictionary of NSMutableSets. Each set entry is a string, something like this: NSMutableSet *mySet = [NSMutableSet setWithObjects: [NSString stringWithFormat:@"%f", time1], [NSString stringWithFormat:@"%f", time2], [NSString stringWithFormat:@"%f", time3], nil]; // time 1,2,3, are NSTimeInterval variables ...

How to get the difference between two dates ?

I have two dates in format(MM/dd/yyyy hh:mm:ss:SS). For the both dates I have converted the two dates to strings by using (stringFromDate) method. But I could not get the difference between them and show them in my console. Please give me an idea how I should get it? Thank you. ...

Checking if a file exists in the App folder.

Hey you lot (again), I was wondering if anyone knew a fast and easy way to see if a file (namely a textfile), exists inside the App folder? And how to handle an Error correctly if the file doesn't exist. Help would be grand! :) ty! ...

Cocoa - array not sorting?

I have this set NSMutableSet *mySet = [NSMutableSet setWithObjects: @"2", @"8", @"7", @"0", @"3", nil]; I copy the set to an array and sort it using NSArray *sortedArray = [[mySet allObjects] sortedArrayUsingSelector:@selector(compare:)]; The resulting array is in exactly the same order as the set and is not being sorted. Why? tha...

Calling javascript from objective-c code

Hello! I found a lots of ways to call objective-c code from javascript, but I want to call the javascript code from objective-c. Last time I submitted a HTML FORM from objective-c, and now I wan't to call a javascript method. What do you think, is there any way to call it and get the response? I am interested in any solution, but I star...

object cannot be set - either read-only property or no setter found

I am having trouble over simply assigning a value to a UI Button: //Assume rect is defined rect = CGRectMake(13, 10, 48, 48); profileButton = [[UIButton alloc] initWithFrame:rect]; profileButton.buttonType = UIButtonTypeCustom; I am getting "object cannot be set - either read-only property or setter found" when trying to assign the bu...

is it possible to make a Dynamic application with NSClassFromString() ?

I want to use XML or JSON to told my app. I want to make a dynamic application that will change a feature by passing class from XML. is it possible ? if YES, could you please show me how to use NSClassFromString to interface with XML or JSON parser? ...

How do you order the animation of a sprite one after the other in cocos2d ?

I have two sprites. Both should animate. But sprite1 should animate first and after completion of the animation of sprite1, sprite2 animation should start. Can I say to a sprite to run from a certain time and end at a certain time ? This is my problems. Please explain how can I do that. Thank You. ...

Behaviour of openURL tel: on iPhone 3.0.1, is it asking for confirmation before dialing?

I know that on 3.0 there is a confirmation alert. I know that on 3.1 there is NOT a confirmation alert. How it is on 3.0.1? Is there some docs about it? Maybe someone can check on their iPhone? (On 3.0.1 of course) thanks ...

cocoa - IF failing for double?

I have a set of NSTimeIntervals like this: NSArray *mySet = [NSArray arrayWithObjects: [NSNumber numberWithDouble: time1], // [NSNumber numberWithDouble: time2], [NSNumber numberWithDouble: time3], nil]; // suppose that at this time // time1 = 0.00000 // time2 = 18.3200 // time3 = 21.6500 at some point in my code I want to ...

Why are the contents of my UITableViewCell disappearing?

Hey everyone, I am learning about using the checkmark cell accessory and am wondering why the contents of my cell is disappearing when toggling it. Here is my code: + (void) toggleCheckmarkedCell:(UITableViewCell *)cell { if (cell.accessoryType == UITableViewCellAccessoryNone) cell.accessoryType = UITableViewCellAccessory...

Search Display Controller Crashes When Returning Results

I have a tableview with a search display controller. It has been working fine in the past, but recently has started crashing for certain search results. Here my code searches a Golfer based on their Name, Age and Handicap. The data is correctly loaded into the table, I can access and drill down to receive further information. However...

cocoa - converting a double to string

I have a double number and I would like to convert it to string. The number is, for example, something like 24.043333332154465777... but if I convert it to string using something like NSString *myString = [NSString stringWithFormat:@"%f", myDouble]; The string is just 24.043333 how do I get a full string the corresponds to the wh...

How do I build the jailbreak iPhone toolchain on Snow Leopard?

I want to build the toolchain for iphone on the snow leopard.I search on google and the answer is always for leopard.I replant it on snow leopard but there are some error.I can't build it.Does somebody had build it? ...

Where can I find a list of pushViewController transitions?

Hey everyone, Where can I find a list of transitions for bringing a new Viewcontroller onto the stack. My line of code is: [peoplePicker pushViewController:myDetail transition:6]; after selecting a contact. Where can I find a list of transitions, and why does "6" work correctly? Also I get a warning with this code saying it may not ...

How do I pass a bool into locationManager on iphone with startUpdatingLocation?

I want to pass a flag into my location manager function - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation so it will look like - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocat...

Problem dismissing multiple modal view controllers

I am having trouble getting my modal view controllers to display properly. I have a parent view controller that is the delegate for modal view A. In modal view A I am presenting modal view B, and having the delegate dimiss modal view A. When modal view B appears it seems to display but the screen dims, and the UI locks up, but the app d...

How to use the variable declared in one class in another class in Obj C.

I have a NSDate *date1 in class1 implementation file(I initialized it as Global variable). I have NSDate *date2 in class 2 implementation file (initialized it as Global variable). I need to calculate the NSTimeInterval between the two dates in class 2. But I could not do it. I could not access date1 in this class. It is giving error as (...

How to change Volume of MPMoviePlayerController programmatically.

Hi i want to change MPMoviePlayerController. is-tend of default system sound i want set other game volume anybody know the answer ...

Audio looping in Objective-C/iPhone

So, I'm finishing up an iPhone App. I have the following code in place to play the file: while(![player isPlaying]) { totalSoundDuration = soundDuration + 0.5; //Gives a half second break between sounds sleep(totalSoundDuration); //Don't play next sound until the previous sound has finished [player play]; //Play sound NSLog(@" ...