Posts

Showing posts with the label ObjectiveC

Blocks Guide

http://rainbowcoding.com/simple-guide-to-objective-c-blocks/

NSNotificationCenter

http://blog.isotoma.com/2009/11/on-objective-c-delegates-and-nsnotification-objects/ http://stackoverflow.com/questions/1382241/multiple-delegates-in-objective-c

Localizing iPhone apps

Tutorial on localizing iPhone apps and the associated XIB files http://www.switchonthecode.com/tutorials/a-simple-localization-example-for-the-iphone Website for fast and cost effective translations http://www.icanlocalize.com/

Great advanced iPhone tutorials

http://www.raywenderlich.com/tutorials awesome source Some CG Functions http://blogs.oreilly.com/iphone/2008/12/useful-core-graphics-functions.html

Objective C Comment Tags

Hi While writing a software one has to work across multiple files and its easy to forget those mental notes we make to revisit certain parts of the code. Objective C and Xcode provide some niftly tags to mark these areas in the code. The Tags are: 1) TODO Syntax: // TODO: add function call 2) FIXME Syntax: // FIXME: remove view and add image 3) ??? Syntax // ???: How does this work? 4) !!! Syntax // !!!: to be verified Via: http://iphonedevelopertips.com/xcode/xcode-fixme-and-todo.html

Base64 encoding in objective c

this is what worked for me. May be a lot more later. reference: http://stackoverflow.com/questions/392464/any-base64-library-on-iphone-sdk // // encode64.m // encode64vr1 // // Created by Shubham Goel on 11/11/10. // Copyright 2010 What an App.com. All rights reserved. // #import "encode64.h" @implementation encode64 static char base64EncodingTable[64] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v...

Time delay in Objective C

[NSThread sleepForTimeInterval:5]; this adds a time delay of 5 secs

UIAlert View with UITextField and Controls

Image
Apples philosophy with UIAlert view is to deliver alerts and offer very limited control. There are many hacks on the internet to add a UITextField subview and use its value. The most effective way I found to do this is as follows: Alright, here's the goods. The first thing that you'll want to do is to alloc your UIAlertView and then initWithTitle:message:delegate:cancelButtonTitle: otherButtonTitles: just like normal. Then with all that good stuff done, you use the method addTextFieldWithValue:label:. The value is for initializing some text into the text field. The label is for setting a placeholder. Here's some example code. Code: UIAlertView *myAlert = [[UIAlertView alloc] initWithTitle:@"Alert title" message:@"alert message" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Ok", nil]; [myAlert addTextFieldWithValue:nil label:@" "]; [[myAlert textField] setTextAlignment:UITextAlignmentCenter]; [[myAlert textFie...