iphone

How exactly can I use shark to profile my iPhone app?

I want to use Shark on OS 10.5 to do some basic profiling of my iPhone game (Open GL ES + Objective C). How exactly can I do this? I've read tutorials but they are too verbose for me after a full day of coding at work and a few hours of iPhone development afterwards. ...

Custom Cell from nib leaking

I have a subclass of UITableViewCell and am trying to use it. At the moment it does display fine as a test but I get leaking errors to the console... - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CustomCellIdentifier = @"CustomCellIdentifier "; ...

Remove white space from ABPersonRecord iPhone

After weeks of frustration I was advised that the problem with my iPhone App was white spaces in the stored phone numbers. My XCode app phone dialer would only dial 7 digit numbers. ig; 555-1212. My question today is, is there a way to remove the white spaces? My iPhone's Contact Book and revealed that my 10 digit numbers were automa...

Another iPhone memory leak question!!

Hi. I have a simple example of what I don't understand about memory management on the iPhone: - (IBAction)AssignAndReleaseOne :(id)sender { for (int i=0;i<10;i++) { someString = [[NSString alloc] initWithString:@"String Assigned"]; } [someString release]; } - (IBAction)AssignAndReleaseTen :(id)sender { for (int i=0...

iPhone - combine two wav/caf files into one

Hi Is it possible to combine two wav files into one as if they've been played simultaneously? I need to do this programatically. The only way I found till now is to play both simultaneously and record the output using AVAudioRecorder. But this won't work if the user's using headphones. Can someone please point me to the right directio...

Is NSFetchedResultsControllerDelegate 'ChangeUpdate' behavior broken?

The docs for NSFetchedResultsControllerDelegate provide the following sample code - (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath { UITableView *t...

iPhone dashcode xmlhttprequest no response

I'm developing an iPhone web app with dashcode. My app runs fine when I browse it with the iphone simulator. When I deploy it to a web-server, I never get a response from XMLHttpRequests. Here's the code I use: function get(feedURL, handler) { var onloadHandler = function() { handler(xmlRequest); }; var xmlRequest = new XMLH...

Why can't I set my button's shadow colour?

I'm trying to set the shadow colour on a UIButton, but all I seem to be able to get is a mid grey. UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; button.frame = CGRectMake(20, 20, 200, 100); [button setTitle:@"a" forState:UIControlStateNormal]; [button addTarget:self action:@selector(buttonPressed:) for...

CGImageRef resize without scaling

Hi, I have a CGImageRef that is lets say 35x35. I'm using it and a mask to create another image, but the mask is 50x50. CGImageRef subImage = CGImageCreateWithImageInRect(imageRef, CGRectMake(x, y, 35, 35)); CGImageRef xMaskedImage = CGImageCreateWithMask(subImage, mask); Apparently this stretches the subImage out to be 50x50, but w...

Debugger Error

Hi All, I have a problem On 3GS Iphone.When i deploying a application on phone then it exited with following error. "The Debugger has exited due to signal 11 (SIGSEGV).The Debugger has exited due to signal 11 (SIGSEGV)." After that application not started & it installed on phone but when phone disconnected then it works. So Pls. h...

iPhone Development - SVG image in UIWebView

Hi all, I'm trying to display an svg graph with associated javascript in my application using UIWebView. The .svg file is stored locally. The problem i'm facing is that the zoom in/out and scrolling is horrible. This happens with large images. I've tested this in simulator. Does anyone know the reason? I've tested quite a few svg grap...

UIAlertView in Landscape mode

I have set my iPhone in the landscape mode but when I try to display the UIAlertView its come in the portrait mode. How it will display in landscape mode? ...

Where can I get the source code from apple's GLImageProcessing example?

I was reading on a blog that there's a GLImageProcessing example from apple. I couldn't find it on apple's site. Does anyone know where it is? ...

duplicate rows in tableview on uitableviewcell

I have found some posts which are similar to my issue but not quite the same. In my app the user can navigate between several uitableviews to drill down to the desired result. When a user goes forward, then backward, then forward, etc it is noticeable that the rows are being redrawn/re-written and the text gets bolder and bolder. I ...

NSDictionary data not persist

Hi, I have a NSDictionary object containg array of objects for particular keys, problem is that i call a funtion in a class which populate this dictiomnay and return ,when i access object for key it returns me an array containing same number of objects as i inserted but when i try to access the individual objects in this array i got an o...

How to add a naked CALayer as "subview" to a UIView?

I think that adding a CALayer as "subview", somehow, does save a lot of memory. A UIView always comes with 3 copies of it's content bitmap (presentation layer, render tree and another one, plus the view itself, so every pixel is saved 4 times). But how could that be done? ...

How would you parse the integer out of this XML response in Obj C?

I am working with an API where I get a response back this this, and I want to parse the integer ID out of it: <?xml version="1.0"?> <trip>328925</trip> How would you parse this? I have some really fragile code I want to get rid of, and I'd appreciate some advice: if ([[response substringWithRange:NSMakeRange(0, 21)] isEqualToStr...

understanding methods in objective-c

for example we use this method in the tableview - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 16; } i want to learn we don't call this method in anywhere but application reads this value how is it being? there are a lot of methods like this we did not call. ...

Fetched property and NSPredicate

I know how to use NSPredicate with relationships but for some reason when I do the same thing with a fetched property I get: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'keypath address.id not found...' where address is a fetched property. The code is like this: [NSPredicate predicateWithFormat:@"...

Header View for a UITextView?

Hi there, I want to have a custom view at the top of my UITextView that will scroll with the text view, so it is only visible when the text view is scrolled to the very top. Can this be done? I was thinking that because it is a subclass of UIScrollView there may be something that can be done. Thanks! ...