iphone

Objective C: @property(retain) doesn't call retain?

I was trying to track a strage memory allocation bug so I overrode the retain and release methods of my class. I noticed that when assigning an instance of this class to a property of another, the retain count of the object increased, but my redefined retain was never called. How can this be possible? Are (retain) properties retaining t...

can i use NSStrings in alerts in iphone objective c?

I am trying to make an app where the user clicks a button and an alert pops up with the text from a textfield in it. But whenever i try, i just get a blank alert. This is my code: @synthesize label; @synthesize textBox1; @synthesize text; - (IBAction)buttonClick { UIAlertView *someText = [[UIAlertView alloc] initWithTitle: @"Text fr...

UISearchDisplayController is not displaying any cells

I have a UISearchDisplayController that is properly hooked up in IB. delegate = Files Owner searchBar = Search Bar searchContentsController = Files Owner searchResultsDataSource = Files Owner searchResultsDelegate = Files Owner When my UITableView calls numberofRowsInSection the correct number is returned. However, my cells in cellFo...

NSMutableArray getting overwritten on every pass within a loop

greetings Cocoa masters - this simple issue has me crawling the walls. I have a custom class called Movie which consists of a bunch of properties and a few collections. I am populating it successfully using FMDB and SQLite. However, with each pass through the result collection from the DB, my addObject: seems to be writing over the entir...

Return number of Enum Values. ( Size of Enum typedef )

Is there a built in function or a way to query the size of an emun typedef? typedef enum difficultyTypes { kEasy, kMedium, kHard } difficultyType; I would like a way to query and have it ( in this case ) return 3. I could even deal with it returning 2 as the highest value ( 0,1,2 ). Or am I forced to use another int variable that I s...

Avoid UITableViewCell moving when toggling between editing mode

Alright, I have some weird behavior and this question goes to the people out there that got that issue already. I have 4 different subclasses of UITableViewCells. They are all very similar (I can't see the differences that would bring the problem up). Now my UITableView's delegate have the following code: - (UITableViewCellEditingStyl...

iOS/iPhone style question for handling events

I am just starting out with iOS programming. I'm currently looking through the MoveMe example and had a question about event handlers. In the example, they have the MoveMeView (subclass of UIView) handle events (touchesBegan:withEvent:, etc.). It seems like this belongs on a controller though, not the view. Is there a standard way of doi...

Updating UITableView will cause exception

I have UITableViewController subclassed and implemented the following NSFetchedResultsController with its delegates tableView:sectionForSectionIndexTitle:atIndex: tableView:titleForHeaderInSection: In controller:didChangeObject:atIndexPath:forChangeType:newIndexPath: case NSFetchedResultsChangeMove: [tableView deleteRowsAtIndexP...

Using UIPanGestureRecognizer and CATransform3DScale to enlarge dragged element

I want to implement a delayed 'enlarging' animation on an UIView that is being dragged using an attached UIPanGestureRecognizer. I've been using something similar to the following code: UIView* innerView; CGPoint startingPoint; - (void)viewDidLoad { innerView = [[[UIView alloc] autorelease] initWithFrame:CGRectMake(0, 0, 200, ...

Wrap text in UIPickerView row

I am implementing UIPickerView so that the user can select one of 5 answers. Each answer, by default, has its own row. The problem I'm running into is that the majority of answers contain more text than just one row. This results in displaying a brief introductory phrase interrupted by an ellipsis. I need the text to wrap onto subsequent...

how do I make content scroll dynamically in a DIV on Iphone's safari or android's webkit?

my code: for(var myLine = 0; myLine < 100; myLine++) document.getElementById("myDiv").innerHTML += "line " + myLine + "<br>"; ............... <div style="position:...etc; overflow:auto;" id="myDiv"></div> this works without a glitch in every browser on all non mobile platforms. However... when this is implemented on iPhone (...

How do I trigger execution of a method within an iPhone application from Javascript?

Is it possible to trigger the execution of a method within an iPhone application from Javascript on a web page? For example, I'd like to have a button that opens the iPhone camera application. Is this possible? ...

Leaks on the phone but not on the emulator?

Hey all, I have a problem and I'd like some advice. I'm working on a document viewer that's composed of the following major parts: zip library which unpacks the document container (minizip) xml library which parses the document (libxml2) UI code which renders the document on screen Nothing too complicated or fancy. On the emulato...

Who own the object return by insertNewObjectForEntityForName:inManagedObjectContext:

My test code: NSManagedObjectContext *context; ..... NSAutoreleasePool *pool = [NSAutoreleasePool new]; User *u = (User *)[NSEntityDescription insertNewObjectForEntityForName:@"User" inManagedObjectContext:context]; NSLog(@"after create:%d", [u retainCount]); [context deleteObject:u]; NSLog(@"after delete:%d", [u retainCount]); [context...

Is it possible (How) to have an application return custom search results in iPhone's spotlight search?

I am working on making an application that will store information, and for user convenience I'd like to make it possible for them to use Spotlight (scroll to the left until search appears on the home screen) to search for items in the app. Is this possible, and if so, can you point me to a reference? I have had no luck in finding this, ...

MPMusicPlayerController function stop causes crash

Hello everyone I use codes below to play ipod audio library. if( musicPlayer==nil) { MPMusicPlayerController* playa=[[MPMusicPlayerController alloc]init]; musicPlayer=playa; [ playa release]; } musicPlayer = [MPMusicPlayerController applicationMusicPlayer]; [musicPlayer setShuffleMode: MPMusicShuffleModeOff]; [musicPl...

NSFetchedResultsController and transient property for sections

In data model I have transient property uppercaseFirstLetterOfName which will return first letter of persistent property. I specify this property in NSSortDescriptor* sortByWordDescriptor = [[NSSortDescriptor alloc] initWithKey:@"subject" ascending:YES]; NSArray* sortArray = [[NSArray alloc] ini...

Dreaded "The executable was signed with invalid entitlements"

Hi, i have the "The executable was signed with invalid entitlements" error. The error only occurs when im trying to set TRUE to the Entitlements.plist of get-task-allow. The reason for trying to do this is because im trying to get the device token to be shown in the console, using the device token later for push notifications. Though, ...

How can I fix the behaviour of UIPicker and UIDatePicker views when they are pushed to a landscape navigation controller?

I have found something I don't understand with the UIPicker and UIDatePicker views - when I make a view with either of these, centered at the top of the view, I set it horizontally to have all the auto resize options selected (Looks like: H<-->H in interface builder, third tab of the inspector in the red box). This works as expected whe...

In iphone-exif how to see updated image metadata info?

I am new to iphone programming. using google code iphone-exif, i can read/write images tags also i can add custom image tags. But, my problem is that how can see the updated data??? OR is there any way to save image with updated data?? I have used .jpg image from net, is in other resources folder. Here my code (.m file) NSString *file...