Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

CaptSaltyJack

macrumors 6502
Original poster
Jun 28, 2007
351
1
Files Owner is a placeholder for the object that will control the view. It's associated with a particular class so you can access actions and outlets on that class, but it allows you to use different instances of the class for different views.

*whoosh* right over my head.. :eek:

Man, I don't know how people are picking up a book and coding iPhone apps within a week...
 

ayasin

macrumors 6502
Jun 26, 2008
318
0
*whoosh* right over my head.. :eek:

Man, I don't know how people are picking up a book and coding iPhone apps within a week...

What other languages do you know? I might be able to explain it in the context of those languages so you get away from the Objective C confusion and can focus on the concept.
 

CaptSaltyJack

macrumors 6502
Original poster
Jun 28, 2007
351
1
I know C, but just command line (no GUI). I know PHP. I also know C#.NET, but that's ridiculously quick and easy to build apps. I just wish Xcode/Cocoa was as "rapid app" as C#.NET :(
 

ayasin

macrumors 6502
Jun 26, 2008
318
0
I know C, but just command line (no GUI). I know PHP. I also know C#.NET, but that's ridiculously quick and easy to build apps. I just wish Xcode/Cocoa was as "rapid app" as C#.NET :(

Once you get used to it it's actually pretty fast. I find it much nicer than C# (and I've been doing .NET since beta including writing a bunch of stuff to dynamically generate IL). In C# say you have a class and one of the members of the class is an interface that you're going to call to do things for you. The interface is basically like what the "files owner" is in IB. Once you attach an object that implements that interface to the class, the class can do whatever it needs to with that object. That's what the framework does when you load the view (it attaches your implementing object to the interface). Just like with your class that has the interface, if you change the object that's implementing the interface you can have different things happen or different sets of data.

Hopefully that helped and didn't confuse you further ;). That's not exactly how it works in obj-c but it should give you the general concept. Anyway, I'm tired so I probably don't make enough sense right now :p
 

ooo

macrumors 6502
Nov 23, 2007
257
15
UGH! Regarding that Cocoa book, chapter 8. What the heck?? He just breezes through building this app called RaiseMan, and doesn't explain anything. He throws out all these names like canRemove, arrangedObjects, etc., and doesn't explain them one bit.

This is kind of frustrating. A few examples here...



Say what? What's the reasoning behind doing this? The first paragraph makes sense mostly, it's associating the NSArrayController with the class "Person".. an array of people. Fine. But the second paragraph above.. what the heck? Up to this point, we've never even used the "File's Owner" object. There was never an explanation of what it is or how it works.

He continues on in a similar fashion, and the chapter ends with no explanation of what any of this means. Keep in mind, I have experience in C and C#. I don't think I'm unable to grasp this stuff, I just think his teaching style isn't so hot, unless I'm missing something, or he explains all this in detail later in the book. If the rest of the book is just the "follow these steps blindly" kind of approach, I'd rather just sell/donate it.

I bought the book and stopped around the same point. It got a bit too complicated for me, like I could learn it and do copy and paste but I didn't think it would stick in my head. I decided to jump right into iphone sdk after that point, but that got me no where. Now I'm back to square one, waiting for the nda to lift and some books to show up.

I understand object c, but I feel like it doesn't really help. It's more about understanding how to use interface builder and linking it with the iphone sdk. I feel there are too many ways to something. It almost feels like php.
 

CaptSaltyJack

macrumors 6502
Original poster
Jun 28, 2007
351
1
I gave chapter 8 another chance, another read-through. Made sure I had plenty of sleep. ;) I think I got it now. It's just one of those things you have to drill into your head and do it over again, and maybe draw a diagram of your classes and vars/methods, and figure out what's going on.

Heck, I'll probably go through chapters 7 and 8 again, as that's where things start to get a little complicated for me.
 

ooo

macrumors 6502
Nov 23, 2007
257
15
Now the problem is, I don't see how those chapters are useful in the iphone sdk. If you look at the iphone sdk, a lot of controllers and stuff you can do in cocoa are not available in the iphone sdk.
 

CaptSaltyJack

macrumors 6502
Original poster
Jun 28, 2007
351
1
Now the problem is, I don't see how those chapters are useful in the iphone sdk. If you look at the iphone sdk, a lot of controllers and stuff you can do in cocoa are not available in the iphone sdk.

They're not useful for the iPhone.. the book is "Cocoa Programming for Mac OS X," after all.. not ".. for the iPhone."
 

DipDog3

macrumors 65816
Sep 20, 2002
1,193
814
I bought the book and stopped around the same point. It got a bit too complicated for me, like I could learn it and do copy and paste but I didn't think it would stick in my head. I decided to jump right into iphone sdk after that point, but that got me no where. Now I'm back to square one, waiting for the nda to lift and some books to show up.

I am kinda at the same point. I read the book, but it got to the point where I couldn't understand what it was talking about. The I started back with the examples and that didn't help, and now I am back to square one!
 

Stile

macrumors member
Jun 7, 2007
41
0
I'm pretty new to all this as well, but I believe all of the binding tools in IB for Mac applications is not available for iPhone applications. In fact the Bindings inspector is not even there. So a lot of chapter 8 would be unusable on the iPhone.

It took me awhile to figure out what was going on in IB and it's relationship to the code I was writing. It all seemed rather magical like VB, blahh! I also have been doing .Net programming since version 1 of the framework and when you build UI's in Visual Studio it would actually create/modify code for you. IB is not like this (which is actually quite fortunate, Visual Studio 2003 would sometimes completely screw up your code), IB appears to simply set properties for classes that get instantiated when your application is running. So you create a View in IB and change all those values in the inspectors, when your application runs a class is instantiated and all those properties you set are applied to the new object. If you want a custom class to be hooked up to your View in IB you simply created one and set the Class name in the appropriate inspector field. Same goes for the controller.

The First Responder has something to do with keyboard events or something like that, I've not really had to mess with that at all so I'm a little fuzzy about it's use. All the ctrl+dragging that occurs is simply linking variables for objects, such as dragging a controller onto a view to set the controller's view property. You can create variables in your classes that can reference controls in your interface. So if you have a text field that you want to manipulate in code you would create a variable in your view or controller class like this:

IBOutlet UITextField *textField;

Then from IB you would be able to ctrl+drag your view onto the text field.

A delegate is like a reference to a C# interface. Some delegates require a specific protocol be implemented. A Protocol is very similar to an interface definition in C# but not all of it's methods are always required. I think I read somewhere that delegates were created as a way of extending a class through composition as opposed to subclassing.

Like I said, I'm pretty new to this as well. Some of it still seems foreign to me but once you start getting used to it you'll see the patterns and it will start to make more sense. Hopefully I didn't confuse you even more :) Apple really has made some cool APIs though. I just started messing around with the CoreAnimation stuff, it's very cool.
 

avayan

macrumors newbie
Jul 29, 2008
1
0
Very pleased to have found you all

Yup! I am not alone.

I am in fact impressed by the fact that most of you guys have exactly the same questions and impressions I have been suffering from the past two weeks. Hence, I will not ask the same questions again.

I already bought the Objective C Book. I have read 80% of it and I am to the point where I do not think it will help any more. So Now I read about the Cocoa for MAC OS X book, but OSX Cocoa is clearly not the same as Cocoa Touch (or Iphone stuff). I read mixed reviews on how useful the book will be. What the heck, I'll buy it anyway, first thing in the morning tomorrow.

So here is the question. I have seen video tutorials for the IPHONE dated to march 2008, when the SDK was first released but with no Interface Builder. Hence, it was all about quite a lot of typing like in the old MS Visual C days.

I feel very good at programming on VB6 and BCB environments, which I can see IB will not be like. So... Is there like a video training out there of the steps that I need to take in order to link an outlet (or whatever it is that needs linking) to a class (or whatever the first whatever is linked to)? I have read a lot of stuff here, but unfortunately I am a VISUAL guy (which must be why I do so well with the Visual Object Oriented stuff).

Whatever the case, I know that together we will figure it out. Thanks for your input.

Best regards,

Mega-NOOBIE as of 7/29/08
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.