objective-c

Change the contents of a UITableView via a swipe?

Im currently using a UITableView like any other, and I am researching into the ability to perform a swipe gesture on the screen, which will then shift the contents of the visible table over to display new content for example: swiping right-to-left on the screen would change (via animation) the contents within each of the cells on screen...

Loading animation Memory leak

Hi, I have written network class that is managing all network calls for my application. There are two methods showLoadingAnimationView and hideLoadingAnimationView that will show UIActivityIndicatorView in a view over my current viewcontroller with fade background. I am getting memory leaks somewhere on these two methods. Here is the cod...

Accessing objects on one nib file from another nib file

I have two nib files Main.nib and Preferernces.nib I have a class CalendarView.m that inherits from NSView .It has a method for drawing calendar - (void)drawCalendar; In Main.nib window I have NSWindow(My Main window) which has an NSView item on it for displaying calendar.Main window has an NSPopUp button that shows a menu when applicati...

NSURLConnection shown as leaking in instruments

Hello another stupid question regarding leaks and also NSURLConnection. How do i release it? Is it enough if i release in the following 2 methods? (void)connection:(NSURLConnection *)connection didFailWithError:(NSError *)error (void)connectionDidFinishLoading:(NSURLConnection *)connection Because in instruments it shows me the line...

Accessing objects on one nib file from another nib file

Possible Duplicate: Accessing objects on one nib file from another nib file I have two nib files Main.nib and Preferernces.nib I have a class CalendarView.m that inherits from NSView .It has a method for drawing calendar - (void)drawCalendar; In Main.nib window I have NSWindow(My Main window) which has an NSView item on it f...

Problem with the url encoding?

Hi guys, here I am using the URL encoding by using the methos as: Iam passing the url as parameter to this method -(NSData *)addActon:(CustomerDetails*)aCustomerDetails { NSString* addCustomerString=@""; addCustomerString=[addCustomerString stringByAppendingString:@"<Customer>"]; addCustomerString=[addCustomerString stringByAppendingS...

Not saving all Core Data objects

I'm developing an iPhone app which downloads data from the internet and creates objects from that data. It is possible to create the same type of object on the device. The objects from the web should not be saved in the Core Data database, but the objects created on the device should. When I save i use this standard call: NSError ...

how to use tooltip in objective C?

how to use tooltip in objective C? ...

OpenGLES - Rendering a background image only once and not wiping it

Hello, first time asking a question here but been watching others answers for a while. My own question is one for improving the performance of my program. Currently I'm wiping the viewFrameBuffer on each pass through my program and then rendering the background image first followed by the rest of my scene. I was wondering how I go about...

objectWithFieldNAme Best Practice for CoreData

Hello, I'm trying to implements some methods for my CoreData models and I'm wonndering if the way I'm doing it is a good practice. I want to implement methods of the type getObjectsWithFieldName. This methods could be used by severals views. So the way I'm doing it is implementing a Class method in the model in the following way: +(...

Why does sqlite3_bind_int not appear to be working in my code?

Hi I am new to iphone, i tried to select the values from database i gave the conditions through sqlite3_bind_int() everything worksfine (ie. Database is opened) but when i compile the line sqlite3_step(statement) it is not fetching the values but according to my query it should fetch values. I dont know weather the values are binded. A...

setting target for disclosure button on subclassed UITableViewCell

I've created a subclass of UITableViewCell to create some custom appearance and UI functionality ('swipe to reveal delete button'). Some of the cells are disclosure/detail disclosure type, and have a UIButtonTypeDetailDisclosure etc added manually. I cannot use the table view controllers' UITableViewCellAccessory for row at index path m...

Creating and releasing objects in the same method, while using self as delegate

In objective-c you are responsible for releasing objects you allocate, but what happens when you allocate an object in a method, assign self as the objects delegate, and then release the object. The callbacks from the newly created (and released) object fails at this point, or rather, doesn't happen. - (void)doSomething { MyObj *m...

Can I use drawRect to refresh a UIView subclass?

I've created a subclass of UIView called Status which is designed to display a rectangle of a certain size (within a view) depending on the value of a variable. // Interface #import <Foundation/Foundation.h> #import <QuartzCore/QuartzCore.h> @interface Status: UIView { NSString* name; int someVariable; } @property int some...

Can you have two different text colors (in the same row) of a UITableViewCell?

I have a bunch of rows with more than one word in them, eg. "John Appleseed". I want the last word in each to be red, with the preceding words black. I know how I could rearrange the current label layout and have two with different colors, but I'm not sure that would work out. I'd have to create a label for "John" (with the width it nee...

Transform.Translation problem on rotation

I am using the following to scale and reposition a UIView layer when the device rotates to landscape. [containerView.layer setValue:[NSNumber numberWithFloat: 0] forKeyPath: @"transform.translation.x"]; [containerView.layer setValue:[NSNumber numberWithFloat: 0] forKeyPath: @"transform.translation.y"]; [containerView.layer setVal...

MKMapView Pins Refreshing Color on Click

Hello, I have several custom MKPinAnnotationView on my map with different images(colored pins). Everything works fine until I either click on a pin or change the map to a different view(satellite/road)... when I do either of these, my pins will revert back to the classic red color. Any help would be greatly appreciated. ...

CLLocationManagerDelegate method not calling in iPodTouch

HI all, I was using a sample code which uses CLLocationManager class to determine the current location of user. when i run this app on iPad i am getting the correct location but when i run the same app on iPod Touch i am getting a blank label i.e nothing is displayed on the label .although wi-fi signal strength is good in both iPod and ...

Obj-C: Calling 'release' too many times?

I was looking at someone else's code and noticed they called 'release' on an NSString they didn't own (never called alloc/retain/copy anywhere and it wasn't a property). This looked a bit strange to me and it made me wonder if any strange behaviour can occur if you call 'release' on an object that you either don't 'own' or whose ref cou...

How to access properties/methods in other classes

I have a RootViewController that has some UITabBarController properties: @interface RootViewController : UIViewController<LoginViewDelegate, UITabBarControllerDelegate> { UIBarButtonItem* loginButton; NSUserDefaults* prefs; UITabBarController* arTabBarController; UITabBarController* stvTabBarController; UITabB...