objective-c

iPhone page curl transition animation

I'm trying to instigate a page curl transition with a UIImageView in a Window. This code is in my main init method : [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:1.5]; [UIView setAnimationDelay:delay]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationDidStopSelector:@selector(animCompleteHan...

Reading accelerometer after screen lock

Hi I have an app that reads data from the accelerometer. However after the screen gets locked this not possible. I have tried the following -(void)startMonitoring{ UIApplication *thisApp = [UIApplication sharedApplication]; thisApp.idleTimerDisabled = YES; .... .... } -(void)stopMonitoring{ UIApplication *t...

Is function overloading possible in Objective C?

Is function overloading possible in Objective C ? Well,Most of the programmers says no, But it looks like possible, for example: -(int)AddMethod:(int)X :(int)Y { return X + Y; } -(int)AddMethod:(int)X { return X; } to call 1st one write [self AddMethod :3]; to call last one write [self AddMethod: 3 :4]; ...

iphone: use Entity object created from Core Data?

I currently have a Video object created via Core Data defined as: Video .h #import <CoreData/CoreData.h> @interface Video : NSManagedObject { } @property (nonatomic, retain) NSString * title; @property (nonatomic, retain) NSString * urlImage; @property (nonatomic, retain) NSString * description; @property (nonatomic, retain) NSS...

How do I program pinch zooming on an image view?

Can anybody tell me the code for PINCH - IN and PINCH - OUT on a image view ...

What is the Objective-C equivalent of Java's parseInt()?

Hi,m anew comer to iPhone...before i have developed for Android..Could any one tell me what is the alternate code in objective C..Thanx in advance Int projectNumber = Integer.parseInt(projectNumber.trim()); ...

How to display hexadecimal value in Objective C with leading 0x ?

How to display hexadecimal value in Objective C with leading 0x ? ...

iphone sdk: How to add checkboxes to UITableViewCell??

Hi, some time ago someone already asked this question and a few answers were given but i didn't really understand any of them. So i was wondering if anyone could please write an easy to understand tutorial on how to do the things shown on the image below: http://img208.yfrog.com/img208/6119/screenshotkmr.png I would be so greatful if a...

Problem getting an integer from SQLite

Hi! I am working on an iPhone project where we need to fetch data from aa sqlite database. I have done this many times before, and everything works out fine. But now I am having problems fetching the value of an integer field (the primary key). The varchar fields I can fetch with: NSString *forfatter=[[NSString alloc] initWithUTF8Stri...

show default calendar in my app

Hi, is there an way to push the default calendar of the iPhone on one of my views (= can I call the default calendar to show up)? Than I could use the Event Kit Framework to add some events. Cheers ...

Threading in iphone

I m using NSoperationQueue for load song from server. This code execute when click on diff-diff buttons. NSOperationQueue *queue; NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(loadImage)object:nil]; [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; [q...

UITableView: Adaptive cell height

Hey guys, I'd like to know the best strategy for adaptive cell heights. The cells first know how high they will be when they are created (they contain some textboxes and images) in the cellForRowAtIndexPath method. My idea was to store the cell's height in a NSMutuableDictionary with a cell identifiying key. The problem is that the heigh...

Regarding startUpdatingLocation in iPhone 4

Hi all, I am using startUpdatingLocation to get the current location in iPhone 3G app,it is working properly but when i used the same app in iPhone 4 it does not give the current location. Is there any other method in iPhone 4 to get the current location. thanks in advance! ...

UILabel strange behaviour

hi, i have this: - (IBAction)checkupdate { statusText.text = [[NSString alloc] initWithFormat:@"Checking......"]; everytime i press button, the string get display, ok no problem with that. now when i add NSURLRequest *theRequest = [NSURLRequest requestWithURL: [NSURL URLWithString:@"http:/myserver/version.plist"] ...

Preprocessor error in NSLog

Hey Guys, At the moment im driving crazy with a simple problem. I cannot imagine what's wrong here. In BlaBlaBla_prefix.pch I define the following: #import "SMDeviceManager.h" #define DeviceSpecificResourceName(name) [SMDeviceManager deviceSpecificResourceName:(name)]; But if I know use this function in my code inside a NSog()-call...

how to remove datamodel from core data and add a new one?

Hi, I am working on a iphone application project. we have released one application with a coredata model, now in our new release we like to remove the old one and add a new one. (we are not storing any user values on existing core data model). we forgot to remove the xcdatamodel from our application folder, but we removed all code relat...

Redrawing UIControls/UIButtons on iPhone in BubbleLevel example code

I'm confused about when -setNeedsDisplay should be called by me. As an example, for updating a button with different images between presses (toggling between the two), the example code from Apple shows -setImage being called on a UIButton. There's no call to -setNeedsDisplay that I can find after that, though. So do UIControl methods all...

COREDATA NSPREDICATE BOOL

Hello all, I am currently having an issue pulling all data from db whereby i.e 1 parameter is TRUE. I am using NSPREDICATE and below is a sample code NSManagedObjectContext *context = managedObjectContext_; if (!context) { // Handle the error. NSLog(@"ERROR CONTEXT IS NIL"); } NSEntityDescription *entity = [NSEntityDescriptio...

NSMutableURLRequest proper posting

Hello Stackoverflow, So I am trying to log into my site using an NSMutableURLRequest which presents the credentials via a post. As a noobie, I have some questions about the functionality of this method to make sure I am understanding it. NSString *post = [NSString stringWithFormat:@"username=%@&password=%@&TARGET=%@",LoginId,LoginPw...

Simple bug crashes hangs Xcode.

I have build the simplest possible iPhone program, a window based program. I only changed the testappdelegate.h file to be the following: #import <UIKit/UIKit.h> @interface TestAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; int pos[10]10]; //note the error here. } @property (nonatomic, retain) IBOutlet UIWi...