objective-c

What methods do I have to implement in order to re-arrange the UITableView rows?

For a simple example of using a NSMutableArray of strings called rows, what do I have to implement in my table controller to move the tableView rows and have the changes reflected in my array? ...

how can I use animation in cocos2d ?

hello, I am trying to develop a Roulette game for iPhone. How can I animation (spin) the Roulette board? ...

Can you help me understand retain counts in cocoa/objective-c?

> .h file: NSString *myString; @property (nonatomic, retain) NSString *myString; > .m file: self.myString = [[NSString alloc] init]; If i'm not wrong i will end up with an NSString instance with retain count of +2. Right? I'm curious because Apple's example for Location uses "self." for initialization. Why? I checked and it does show...

Memory leak issue with UIImagePickerController

I'm getting memory leak with UIImagePickerController class. Here's how I'm using it: UIImagePickerController *picker = [[UIImagePickerController alloc] init]; picker.delegate = self; picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; [self presentModalViewController:picker animated:YES]; [picker release]; To remo...

NSTimer and Touches event conflict

hi im trying to execute 2 actions on occurrence of their particular events one is the animation occurring when the a timer with fixed interval is fired and other is also a animation occurring when a touch is detected both r working fine individually but when simultaneously occurring anyone of the animation slows down .its because in the...

Reduce UIImage size to a manageable size (reduce bytes)

I want to reduce the number of bytes of an image captured by the device, since i believe the _imageScaledToSize does not reduce the number of bytes of the picture (or does it?) - i want to store a thumbnail of the image in a local dictionary object and can't afford to put full size images in the dictionary. Any idea? ...

how can i get alert view action

UIAlertView* av = [UIAlertView new]; av.title = @"Dealer offer Insurence"; [av addButtonWithTitle:@"YES"]; [av addButtonWithTitle:@"NO"]; Which button user select how can i know ? If anyone have available solution then help me. I want to some work on these button action. I wait one response..... ...

iPhone GPS Development - Tips + Tricks

Hello - I'm looking for some feedback, blog links, etc that offer some tips and tricks for iPhone GPS development. I've read and understand the API, I have my demo app up and running, etc but I have run into some "quirks" with gps on iphone. For example, it seems that you you will receive a lot less location updates when your iphone ent...

How to split a NSDecimalnumber between decimal & integer & back

I can't figure how get the integral & decimal value from a NSDecimalnumber. For example, if I have 10,5, how get 10 & 5? And if I have 10 & 5, how return to 10,5? ...

Java equivalent of Cocoa NSNotification?

I am writing a Java application using SWT widgets. I would like to update the state of certain widgets upon a certain event happening (for example, updating the data model's state). Is there something in Java similar to Cocoa's NSNotificationCenter, where I can register an object to listen for notification events and respond to them, as...

Pointer issues when using sqlite in an objective-c program.

When i try to compile this as part of an objective-c program it gives the warning: warning: passing argument 1 of 'sqlite3_close' from incompatible pointer type sqlite3 *db; sqlite3_open("~/Documents/testdb.sqlite", &db); /*stuff*/ sqlite3_close(&db); An almost identical error is given with nearly any other function call that uses &d...

Bind user defaults to different identifier

I have a preference pane bundle (it runs in the System Preferences). I designed the interface using Interface Builder where I binded a "start automatically" checkbox to the Shared User Defaults. This works great but it writes the preference to com.apple.systempreferences. I would like to keep my preferences in the com.example.mybundle de...

How can I use OCMock objects with code that calls isKindOfClass ?

Hi, I'd like to test some code with OCMock. The innards of the code are calling [NSObject isKindOfClass] on the mock object I'm providing to the code, like so: if ([object isKindOfClass:[FancyClass class]]) { ...} However, when I provide an OCMockObject-based mock created like this: mock = [OCMockObject mockForClass:[FancyClass clas...

How return back info from a child to parent in a NavigationController

I wonder what is the proper way to get back some message from a child view. I have a object that is edited in the child view. I wanna see in the TableView their modifications. However, I don't know a clean way to do it (I don't like a singleton here). Is possible get notified when the Child view dissapear and get some info on that? ...

Why is the Obj-C GC clearing my reference?

I am writing an Objective-C program that utilizes the garbage collector. I am getting *EXC_BAD_ACCESS* in some situations, the classic example of an object being "over freed". Using some of the debugging tips in this technote, namely MallocScribble and *AUTO_LOG_COLLECTIONS*, I can see that my object is being GC'd out from under me. Wi...

iPhone app in the background

Hi all, Is there any way to start sound or pop-up message from closed iPhone app. Simply like "receive SMS" ...

Can you translate php function quoted_printable_decode() to an NSString-based, objective-C function / category method?

In http://php.net/quoted_printable_decode, I found ways to do it using preg_replace. Anyone who knows any code that could convert a normal NSString to something RFC 2045 section 6.7? Thanks in advance! ...

Best way to copy or move files with Objective-C?

I was wondering, is there a best practice to write an OSX programm that copies or moves a file from one place to another? is there some NSSomething method I can call? Do I have to work with Input/Output streams? Or is the best way maybe to just rely on passing commands to the finder? Bonus question: How do I get percentages a la "co...

Do you tag your UIViews or retain them as properties?

This is mostly a stylistic question but I've been curious what others' thoughts are since I started programming for the iPhone. When you have a UIView in your iPhone application and you need to access it elsewhere in your application (generally in another function in a view controller), do you like to tag the view with an integer and re...

how to implement my own zooming but still have access to the UIScrollView's scrolling?

I would like to use the scrolling/panning functionality of the UIScrollView but I would like to handle all the zooming and scaling myself. My current plan is to have a viewController that owns a UIView (I'll call it view1) with multiple UIViews and UIScrollViews as children. Is it possible for view1 to handle all multi-touch events (in ...