objective-c

Reloading UIImageView Image in a UIScrollView

Hi guys, First some background: I'm using a UIScrollView to make an image visible and zoomable and everything works fine initially, I can view and zoom the image just fine. I'm using a UINavigationController to manage all of my various custom view controllers. After the image is displayed, and the back button is clicked, this view contr...

How can I save the content of a UITextView?

Hey, in my app I want to save the text that was typed in in a UITextView. How can I do this? Thanks for you help. Leon ...

Delete a sub string given a NSRange

Given a String and a Range is there any easy method to get a substring by removing the characters from String which come in the passed Range? ...

Erlang as an embedded system within an application?

I have quite a lot of code written in Erlang, which I want to include in applications written in Objective-C, eg on the iPad. Ideally I would want to have an object that encapsulates the Erlang run-time; this could then be accessed like the standard Erlang shell, something along the lines of: ErlangRT *runtime = [[ErlangRT alloc] init];...

Passing data to objective c with POST rather than GET.

I have been using the url intercept method to pass data from javascript to objective C by passing the data as url encoded parameters and using NSURLProtocol to intercept the request however I am now wanting to send larger amounts of data like say 10,000 character long strings but this does not seem practical to do in a GET request. Righ...

do external javascript on a website objective C

hi! this is my first post so i am sorry for any mistakes i make :) i know the title is confusing, but i will try to explain what i want :) i got this website, on the website there is a schedule, this schedule change when you change different values so that it consist with the appropriate person. when you change a value a javascript fu...

Sorting an NSArray using another NSArray as a guide

So, imagine you have a couple of arrays, Colors and Shapes, like this: Colors: { Yellow, Blue, Red } Shapes: { Square, Circle, Diamond } Now, if I want to sort Colors into alphabetical order I can do something like this: NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:nil ascending:YES selector:@selector(loc...

creating a custom menu system without a UINavigationController

This is related to my previous post, but I am trying to understand what another developer has told me concerning building a custom navigation menu mechanism for the iPhone. I am new to objective C/iPhone stuff, but experienced in programming in general. What I am trying to create is a custom menu system that does NOT involve UINavigation...

Implementing an NSOutlineView to edit the contents of a plist file

I'm writing a game using cocos2d-iphone and our stages are defined in .plist files. However, the files are growing large - so I've developed an editor that adds some structure to the process and breaks most of the plist down into fixed fields. However, some elements still require plist editor type functionality, so I have implemented an...

Setters and Getters (Noobie) - iPhone SDK

Hello everyone, I don't really have a solid understanding of Setters and Getters for objective-c. Can someone provide a good guide for beginners? I noticed that this comes into play when trying to access variables in another class, which I am trying to do right now. I have two classes, lets say A and B. I have a NSString variable in A w...

How did the convention of not puttting any whitespace in Obj-C method declarations come about?

How did it become convention that there is no whitespace in the declaration of a method? -(UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath It seems like everyone does it, 90% of the examples I see, the generated templates, other people's code, etc., etc. I suspect it's just another vi/e...

Passing argument within action selection in UIButton

Given that you have a method -(void)aSelector:(id)anyArgument; And have set up a UIButton programmatically UIButton *myButton = [[UIButton alloc] init] Alright, I get the idea that when you create a UIButton, you have to use the method [myButton addTarget:nil action@selector(aSelector:) for ControlEvents:UIControlEventTouchUpIn...

Cover screen with window in cocoa

Hello- I am writing a Mac application, in Cocoa, that needs the ability to 'lock down' the computer. Basically, I am writing a small agent that will sit in the background and when prompted, throw up a window that covers the entire screen, including the status bar, and shows a message (something like "give me back my computer, thief!"). ...

CGPDFDocumentCreateWithProvider() and CGPDFDocumentCreateWithURL() used on a local file

Most, if not all, tutorials use CGPDFDocumentCreateWithURL(). What is the difference if using CGPDFDocumentCreateWithProvider() instead? Let's say the pdf is being taken from a local file on the device, not downloaded from some website. Will there be a performance difference? Which is better? ...

IPhone Repository for data

I'm a totally noob in IPhone development. Just start a week ago. I'm trying to have this tableview working. I have a class I created called CustomerRepository with a method like this - (CustomerRepository *) init { self = [super init]; if (self) { customerArray = [[NSMutableArray alloc] init]; Customer *cust1 = [[Custome...

Application Delegate Error while integrating Calendar control into my app.

Hi, In my app i need calendar control so i have found out a calendar suitable for my app on the link below: http://blog.webscale.co.in/?p=244 Now i want to integrate that in my project so i am referencing the project into my app but it leads to a crash and console shows exception that unknown CalendarAppDelegate. What should I do? ...

plist number type

when you create a plist and choose number for the type for one of the entries, what type of object is returned when you call on that information later? ...

arithmetic shift

what is the difference between logical right shift and arithmetic right shift? ...

Subclasses of MKAnnotationView

I was wondering if anyone knows of any subclasses for the MKAnnotationView class. On apples documentation they say one example is the MKPinAnnotationView so I was wondering if there were other pre-created subclasses like the one used to track the devices current location. If anyone has tips for creating my own subclass of the MKAnnotatio...

How do you store a function pointer in an ObjectiveC class?

Some of Apple's obj-c API's still use C functions, e.g.: -(NSArray * ) sortedArrayUsingFunction: (NSInteger (*)(id, id, void *))comparator context:(void *)context ...which is great, except I'm struggling to see how you can store fn-pointers inside ObjC classes. e.g. to share the same "sort" function in different parts of your pr...