iphone

iPhone/iPad Dartboard, How Did They Do That?

http://gizmodo.com/5580399/ipadiphone-darts-make-this-whole-fanboy-lifestyle-worth-it How did they do that? ...

Change UIButton state programmatically

I am trying to change a UIButton's state programmatically, so that when i tap it, the background stays blue. I can change the enabled property and that works, but changing selected or highlighted doesnt affect the state. Is this possible? Thanks ...

Dismissing multiple modal view controllers at once?

So have a stack with three view controllers where A is root, B is first modal view controller and C is third modal vc. I would like to go from C to A at once. I have tried this solution to dismiss.It does work but not in a correct way. That is when the last view controller is dismissed it will breifly show the second view controller befo...

Caching to CGLayer slower than redrawing on iPhone

I'm in the process of making a simple drawing program for the iPhone. At the moment, touch events add their location to a list which is connected with a bunch of CGContextAddLineToPoint calls which are redrawn in every call to drawRect. I'm running into performance issues at fairly low numbers of lines (they are transparent, though), s...

NSMutableArray Exc_Bad_Access

I only have this code in m. file NSMutableArray * arrayOfBools; arrayOfBools=[[NSMutableArray alloc] initWithCapacity:1000]; NSNumber *ijk =(NSNumber*) 9; [arrayOfBools addObject:ijk]; Get error o this [arrayOfBools addObject:ijk]; ...

System ignore iPhone rotation

Hey all, Is there a function like beginIgnoringInteractionEvents in UIApplication that ignores rotation instead of touches? I need my app NOT to rotate just in an MPMovePlayerViewController that I present. Thanks [UPDATE] Here's my code -- MPMoviePlayerViewController *mpViewController = [[MPMoviePlayerViewController alloc] initWith...

is [_internal lock] in synthesized accessors the same as @synchronized(self)?

It's fairly well documented that @synthesize atomic settings/getters are implemented with "something" like so: { [_internal lock]; // lock using an object-level lock id result = [[value retain] autorelease]; [_internal unlock]; return result; } The situation I have, I want to access two properties atomically (ie. not u...

How can i use the getter/setter of a Call-Method from Example Code in MailComposer

Hey everyone i have a question regarding the call-methods handling in object-c. I downloaded the apple sample code for the mail composer (http://developer.apple.com/iphone/library/samplecode/MailComposer/Introduction/Intro.html). When the user touches the "Compose Mail"-Button in the sample-code the Methode -(void)displayComposerShee...

Convert location.href URL to Anchor link

Exists any JavaScript or Objective-C method to convert a location.href="MyURL" to <a href="MyURL"></a>?? I have over 200 location.href URL not working with UIWebViewNavigationTypeLinkClicked :-S Thanks to everyone can help me! ...

Using SystemSoundID throughout my app?

Hi all, Can someone please point me in the right direction... I need to use the same sound (a button press) throughout all view controllers in my app. What is the best way to do this. I have managed to load and play a sound in a single view controller but cannot manage to pass a sound to different viewcontrollers because SystemSoundID i...

iphone uibutton: I want to change the UIControlStateNormal image

I have created an array of UIButtons. I need to change the images on those buttons programmatic, at various times. For time being, in order to get this to work, I want to change the image when the button is pressed, but this is not the time this would really happen. So, I create an array of buttons, and arrange them on a grid on the s...

Assigning touch events to elements within canvas - iPad

I'm creating a web app for the iPad and I'm trying to assign a touch event to an element within canvas. I have it set up like this: function initialize() { touch_element = new Image(); touch_element.src = 'img/image.png' touch_element.onload = function(){ canvas.drawImage(football, 50, 50, 184, 120); touch_e...

iphone mobile web + remove safari interface bars

Hello, anone knows how to remove the bar at the top and bottom on safari iphone. I have this mobile web page am writing and I cannot get rid of the navigation bar. Is that even possible ? Thanks. ...

OpenFeint achievements performance

I've decided to integrate OpenFeint into my new game to have achievements and leaderboards. The game is dynamic and I would like user to be rewarded immediately for some successful results, but as it seems for me, OpenFeint's achievements are a bit sluggish and it shows visual notification only when it receives confirmation from the ser...

UINavigationController and UIViewController dealloc

Hi, I recently changed my app to use a UINavigationController, I was using a UINavigationBar before, with cascade subView adding, which was a bit tenuous. I'm facing a problem of memory usage. Leaks tool doesn't show any leak, but ViewControllers I create and add to the UINavigationController never seem to be released. So memory usage ...

Which of the new App Delegate methods for multitasking must I implement to retain the old behavior?

For the moment I don't want to care about multitasking. My app has a very long development trip behind it, and now it has been engineered that way that when the user hits the home button, the app gets killed. When he comes back, the app appears like he left it. If I wanted to get this same behavior back, which methods would I have to im...

Sort an array with numeric strings

Hello I have an array of persons, and i am trying to sort them by age using a sort descriptor. The age field in a patient is a string so when calling: ageSorter = [[NSSortDescriptor alloc] initWithKey:@"age" ascending:YES]; [personList sortUsingDescriptors:[NSArray arrayWithObject:ageSorter]]; It sorts them but 100 appears first becau...

cocoa accept international numbers

I have a calendar and can make local month names and short weekday names, for example weekdaynames with: NSArray *weekdayNames = [[[[NSDateFormatter alloc] init] autorelease] shortWeekdaySymbols]; How can I localize these? For example: a daycounter i = 1..31 daystr = [NSString stringWithFormat: @" %i", daycounter];} I get fine 1....

Rescaling a UITableView for the iPad?

Recently, I have begun porting my iPhone app to the iPad and I have a view with a UITableView subview. Is there any way to rescale the table? The autoresizing masks don't blow up the font and I basically just want a rescaled, crisp, larger version of the table for the iPad. Is there an easy way to go about doing this? ...

Varying iPhone deployment target: Handling Framework constants

Hi, I am building an app that needs to work on multiple versions of iPhone OS and makes use of increased accuracy for Core Location in iOS4. I have code that does the following: if ([m_locationManager respondsToSelector:@selector(startMonitoringSignificantLocationChanges)]) { m_locationManager.desiredAccuracy = kCLLoca...