April 2008 Archives
I'll be going to a few interesting events in the next two months:
April 26 GoRuCo (Gotham Ruby Conference)
from the site: "A technical conference aimed at highly motivated programmers interested in all things Ruby."
April 30 Visualization Day at CUNY
This looks really interesting, with presentations by Ben Schneiderman and other HCI & Visualization notables. The conference is free, which is always a plus.
May 12 - 14 Where2.0 in Burlingame, CA
I've been wanting to go to this conference for a couple years. Always a great line-up of speakers and lots of interesting people and projects. This year's Where2.0 should be excellent - with all the LBS apps and platforms that are launching.
May 17 Smart/Models (AIGA/NY Biz Conf)
AIGA/NY has put together a great looking conf featuring a diverse group of designers and producers discussing... the biz. I'm especially looking forward to Jason Fried's talk on 37signals' approach. There has been a lot of talk about new business models in the creative space, and this looks to be a great round-up of some super intelligent people with highly innovative ideas and methods.
During the past week or so, I've been hacking away on iPhone native app dev. It's been a challenge, as I have very little experience with C, C++, much less obj-c. This entry is more a list of points that have helped me become comfortable than anything else - mostly gleaned from the docs put out by Apple.
File extensions
| .h | header files contain class, type, function, and constant declaration |
| .m | source files contain obj-c and c code |
use #import to include header files in source code - they will load files only once (as opposed to #include)
Strings
NSString* myString = @"My String";
Classes
defined in two parts:
interface (declares methods and instance variables, defines superclass)
@interface ClassName : ItsSuperclass
{
instance variable declarations
}
method declarations
@end
implementation (defines the class, contains the meat)
@implementation ClassName : ItsSuperclass
{
instance variable declarations
}
method definitions
@end
Methods
The names of methods that can be used by class objects, class methods, are preceded by a plus sign
+ alloc;
The methods that instances of a class can use, instance methods, are marked with a minus sign:
- (void)display;
Messaging
think of objects as actors
instead of calling an objects methods, send a message to an object requesting it to perform one of its methods and ask for a return
concentrate on behavior
to send a message:
[receiver message]
to recieve:
objc_msgSend(receiver, selector)
... and with arguments:
objc_msgSend(receiver, selector, arg1, arg2, ...)
basics
- gui interface for UI elements
- benefits of using IB
- graphically add interface elements to your app
- draw connections between ui elems and controllers
- quickly move, add, delete elems
- isolate ui from app code
- creates a .nib file -> contains ::
- objects
- attributes
- relationships
- proxy objects -> "placeholder for an object that is used by the nib file but not stored in the nib file"
- first responder -> target for messages (if not set, message is sent to other objects in the chain)
windows and views
- one window per app
- multiple views
integration
- IB builds the View (in MVC terms)
- IB discovers outlets and actions of Controllers
- IB automatically detects changes in the XCode project classes and delegates connections
basic use
- to add a view,
1. simply drag the object to your nib file
2. select view/object and open inspector window
3. select identity pane
4. type name of class in the Class field, or select the class from the combo box
- creating connections,
1. select source object and open connections inspector
2. click the circle object to the right of the outlet/action, drag over to target object
3. select action methods (if needed)
- remove a connection by clicking 'break connection' box to the left of the name of the connected object
