objective-c

Inconsistent Frame / Bounds of UIImage and UIScrollView

this one puzzles me. I have an Image with a width of 1600 pixels and height of 1819 pixels. I load the image as UIImageView into an UIScrollView and set the "contentsize parameter" iKarteScrollView.contentSize = CGSizeMake(iKarteImageView.bounds.size.width, iKarteImageView.bounds.size.height); NSLog(@"Frame - width %.6f, height %.6f - ...

how to add the element in the array using the for loop in objective-c?

is this the right way to do the same? nsmutablearray *myarray1 //have some data in it for (int i=0;i< [myarray1 count]; i++) { myArray2 = [NSMutableArray array]; [myArray2 addObject:i]; } and how can i print this value of myarray2. ...

CoreData - should I pass an existing NSNumber to set the attribute of an entity, or create a new one ?

Hello, I'm starting with CoreData and I have a question : I have an array with NSNumber objects in it. I need to create an entity Event for each object with only one attribute eventNumber which should also be an NSNumber. Can I pass the object of my array like this : for (int i = 0, i<[myArray count], i++){ Event *newEvent = [NSEnt...

Layers of Images using UIImageView

Hi everyone, I just wanted to confirm, is it possible that we add layers of images using UImageView, one as background and other on top of it. I mean i want to use 2 images one has to be in the background and the other on top of it. ( the size of both these images is 320 x 480 ). Through the attributes inspector we cant do it. Is the...

Objective-C retain counts clarification

Hey, I kind of understand what's retain counts for. But not totally. I looked on google a lot to try to understand but still I don't. And now I'm in a bit of code (I'm doing iPhone development) that I think I should use them but don't know totally how. Could someone give me a quick and good example of how and why using them? Thanks! ...

How to Call JAX-WS Web Service in Iphone

Hello, How to use JAX-WS Web service in Iphone Sdk, anyone has idea then please let me know. Thank You. ...

Call javascript from objective-c, only works with system functions like alert() etc / phonegap

hi havent found the solution yet in the forum. i want to call a function i created in the index.html via a objective-c function. As explained in stringByEvaluatingJavaScriptFromString so the network detection doesnt work for me the function gets called but no javascript is called in the index.html here is the code i use - (void)up...

Apple Push Notification Feedback Service - how frequently does it check

I have been able to successfully create push notifications and I have also received responses from the feedback service, so I am confident that my configuration is correct, but I was wondering, how long after a device has been made inactive, will it be picked up by the Apple Push Notification Service. When I first polled the feedback ...

How can I check that the NSPasteboard is updated?

I'm automating a copy command to place some text on the pasteboard every second or so - unfortunately this is my only way of accessing the text, which is in another application. After copying, I access the pasteboard text and process it. Sometimes, the copy command will be sent when nothing is selected - for example in textEdit, if the...

Dismissing UIImagePickerController from UITabBarController

I have a tab bar application whereby one tab uses a navigation controller to move through a series of views. On the final view, there is a button to add a photo, which presents a UIImagePickerController. So far, so good - however when I finish picking the image, or cancel the operation, the previous view is loaded, but without the tab ...

NSManagedObjectContextDidSaveNotification just called once in application lifetime

Hi all, I have a problem with two contexts. There is the default manged object context and an import context wich is used for imports. When the import context saves its date a notification is send to merge the changes with the default context: here is the code - (void)updateCompleted { [[NSNotificationCenter defaultCenter] addObserver:...

how to load an rsa asymmetric key pair with obj-c on the iphone?

I have the raw bytes of public and private key in a buffer and want to use that information to encrypt / decrypt data. I do know that I could generate a keypair using SecKeyGeneratePair and then save it to the keychain, but i don't want that... essentially, i need the Objective-C equivalent of the following Java Code (using Bouncycastl...

uiimage of uiimageview doesn't update before NSURLConnection sendSynchronousRequest (iphone)

Hi all, I'm replacing an uiimage of uiimageview before calling NSURLConnection sendSynchronousRequest, an as a result i don't see the new uiimage. How i can resolve this? tnx ...

Problem with close socket

Hi, I have a problem with my socket program. I create the client program (my code is below) I have a problem when i close the socket with the disconnect method. Can i help me? Thanks and sorry for my English XP CFSocketRef s; -(void)CreaConnessione { CFSocketError errore; struct sockaddr_in...

API to determine whether running on iPhone or iPad

Is there an API for checking at runtime whether you are running on an iPhone or an iPad? One way I can think of would be to use: [[UIDevice currentDevice] model]; And detect the existence of the string @"iPad" - which seems a bit fragile. In the 3.2 SDK, I see that UIDevice also has a property which is really what I'm looking for, b...

Is there a CoreText equivalent for the iPhone SDK?

Is there a CoreText equivalent for the iPhone SDK? I just need to draw a paragraph of text and programmatically align it to the center of the screen based on the height of the paragraph. UITextfield is overkill for this I think. ...

How do you display a pixel of color C to iPhone coordinates (x, y)?

I've read all Apple documentation on the iPhone development and there's nothing that describes how to do it. Plz help. ...

Core Data, Bindings, value transformers : crash when saving

Hi, I am trying to store a PNG image in a core data store backed by an sqlite database. Since I intend to use this database on an iPhone I can't store NSImage objects directly. I wanted to use bindings and an NSValueTransformer subclass to handle the transcoding from the NSImage (obtained by an Image well on my GUI) to an NSData contain...

how to dynamically recolor a CGGradientRef

I have three CGGradientRef's that I need to be able to dynamically recolor. When I Initialise the CGGradientRef's the first time I get the expected result, but every time I attempt to change the colors nothing happens. Why? gradient is an instance variable ins a subclass of CALayer: @interface GradientLayer : CALayer { CGGradientR...

UITouch Event Propagation To Background UIViews

I'm having troubles getting any UIView that's not the foreground UIView to receive UITouch events. I'm building an all-Core Graphics-app, so I'm not using any built in UIViews or IB or anything - everything is programmatically constructed and drawn into. Here's my view hierarchy: Root View Type A Container Type A View Type A View Ty...