Thursday, May 29, 2008

Saving Data

I just added functionality to the Cocoa Bindings MailDemo app so that it saves the data I enter to the disk.  It's really cool to see it work now because everything that I enter into it is saved.  When I open the application again all of the same data is there.  It's amazing how easy it is to do this and it's cool to see it working.  Now I just have to apply all of this to my application.

Tuesday, May 27, 2008

Cocoa Bindings

I've just finished a short tutorial on Cocoa Bindings.  Bindings seem to go right along with Core Data and the Core Data tutorial recommended I work on both together.  I got to the point in the Core Data tutorial of making a Blog application where I needed to use Bindings so I started reading the Bindings tutorial first.  I got through that so now I have a very basic understanding of what I'm going to do with it for the Blog application.  Bindings kind of replaces all of the actions and methods in Interface Builder that connect the objects and eliminates the need for writing those actions out.  It just directly "binds" objects to certain arrays or objects.  It makes sense how this works closely with Core Data as I'm guessing I'll end up binding display objects to the Core Data entities.

Tuesday, May 20, 2008

Core Data

I'm working through a tutorial on cocoadevcentral about Core Data.  The concepts of it are actually the hardest part.  I don't fully understand what is going on.  However, it is simple to develop with it, as is often true with these Apple technologies.  It is similar to working with Interface Builder in that it is all graphical and no actual code has to be written to use Core Data.  This makes it easy to follow along and know what I'm doing.  Unfortunately, it really is so complex that I'm doing much more with Core Data than I should be able to with my limited knowledge.  So there are a lot of things that I don't quite understand but hopefully they will become clearer as I work with it more.

Monday, May 19, 2008

Journal

Okay so the best idea I came up with so far was a really basic sort of journal application.  It's very basic but I just want to be able to make entries and have them stored on the computer.  Also, if possible, I would like it to be able to connect to this blog so I could write something in my program and have it posted here.  That may not be realistic though.  To do this I've started looking into how to store data on the computer through Core Data.  This is, again, a whole new topic that will take some practice.  The basics of the interface will be familiar to me atleast and shouldn't be too difficult to make.  The challenge will be dealing with and storing data.

Tuesday, May 13, 2008

Ideas

I've been going through different objects and trying to use them in my application.  So far I've fiddled with things like an embedded movie, images, tabs, etc...I'm currently working on trying to figure out how to achieve something I used to be able to do with PHP.  There is a Level Indicator object that gives a graphic representation of the progress of something in the application.  I want that to be able to update when certain things change, without me directly telling it to change through a method.  To do this, the object has to be 'listening' for certain events that tell it to advance its indicator.
I'm also just trying to brainstorm some ideas for what I should actually make.  I'm getting better at doing very basic things and I think it would help the most if I had a specific idea of what I wanted to make so I could know where to go and what I needed to learn.  Then I would be able to learn how to do each of the things I need to make a full application that does whatever I want.  It won't be something all that amazing, but I want it to do something atleast, even if it has already been done by somebody else.

Monday, May 5, 2008

Interface Builder

Well it doesn't really work to create a new Text object because I guess that pretty much has to be done in the Interface Builder.  Due to that, I've started going through more of the Interface Builder library of objects to see what I can add to my application.  I basically just put together a bunch of random interface objects in a window and am now trying to make them interact with each other.  For instance I want a button to make another window appear and another to change some text, etc...It's a challenge to work with creating and closing new windows, as they are similar to the NSTextView objects in that I have to get the window object to display and disappear.

Tuesday, April 29, 2008

Progress

I've just been seeing what I can do on my own now.  Obviously there isn't a lot, but I've managed to change colors of objects and change text in text fields.  I can also set attributes of objects such as fonts and colors and whether the text within is editable.  Of course those methods only apply to certain objects.  What I am trying to do now, with difficulty, is simply be able to create a new NSTextField object and display it.  Previously I have always created the basic objects in the Interface Builder, which is very easy.  Now, I want to actually initialize and make the object with code and specify its location and size, etc.  This is much harder than it sounds however and I have yet to figure it out.  I can initialize the object, but am having trouble actually displaying it.  To figure this stuff out, I'm basically just going through the documentation, which Apple provides, on all of the different classes such as NSTextField and seeing what methods there are that I can use.  This takes time because to get the method I want I have to look at NSTextField, and then all of the classes it inherits from as well to find the right methods. (NSControl, NSView, NSResponder, NSObject, etc.)  I am learning the basics, however, and can now atleast do basics on my own.

Thursday, April 17, 2008

Strings

I finished the tutorial and since I now know some of the basics, I'm trying to do a little on my own.  It still isn't working all that well because I don't know much.  I have started to make some progress though.  It's a lot easier to learn by figuring stuff out on my own rather than just reading it.  Right now I'm trying to simply make a string of characters and have it displayed.  This sounds very simple, though I have found it isn't.  Hopefully I should be able to get that working soon.  The hard part is you can't just create a string, you have to initialize an NSString object and set it to something.  The nice thing is XCode has endless amounts of documentation on Objective-C and Cocoa so I can always find what I need.  The problem is I don't always know what I need, or I don't know exactly how to use what I find.  It is getting easier and easier as I fiddle around with things and see what works and what doesn't.  It's also useful that whenever something doesn't work so the program can't build and run, it tells me exactly what went wrong so I know how to fix it (sometimes).

Tuesday, April 8, 2008

Graphics

I'm now going through the graphics tutorial on the same website.  I've been following through it, but it isn't actually creating an application, so I just tried to fool around with the ideas they used and actually but them into an application...That isn't working very well.  I still can't really do much on my own, but as I try more things I begin to understand it more and why things don't work.  Its a lot more complicated than working with PHP.  PHP just display things on a page and didn't work with memory and connecting things and compiling and windows and all that.

Monday, April 7, 2008

Finished Tutorial

I finished the second tutorial.  It actually seemed quite a bit easier after reading through the C tutorial.  This was both because I understood more, and it was just a simpler tutorial than the other one and less detailed.  Now I'm just kind of seeing what I can change on my own with what I know before moving on to another tutorial.  Right now I just have a text box and I'm working on changing the font and color, etc...

Friday, April 4, 2008

Back to Cocoa

I'm back to working on the second Cocoa tutorial on cocoadevecentral.com.  Now I have a basic understanding of C, it is actually easier to follow along with the tutorial.  I should be able to finish the basic app it makes pretty soon.  I'm not sure what it's going to be yet though.

Thursday, April 3, 2008

Memory

I just finished a C tutorial at theococoa.com.  The biggest difference it talked about between C and PHP is memory.  In PHP you can just create an array and then use it, its the same as making a variable.  In C, however, its much more complicated.  Every variable takes up a certain amount of memory and so in order to make a string, you need to allocate enough memory for multiple variables that make up a string.  So even a simple string is like an array in memory.  Then to create an array of strings is even more complicated because you need to create an array of arrays (or strings) and allocate that memory in the system.  For all of the arrays you first have to allocate the memory and then put data in it and then at the end you have to free it.  This is all completely new because PHP was a web language and really didn't deal with memory at all on the programming side.

Thursday, March 20, 2008

C tutorial

I'm working on the C tutorial on cocoadevcentral.com.  Its pretty helpful to explain the basics of C.  I already know most of it but he doesn't hurt to really make sure I understand it all clearly.  It's also useful to go through the little programs it has and make them to see how they run.  I can also play around with them and see what changes when I edit the files.  Right now I'm learning about structs, which are like variable types that you create and can define what the variables in them will be.  They seem kind of like a combination of a function and an array, but they are something new and not in PHP.  After I'm done with this tutorial I'll go through the second Cocoa tutorial on the site because these seem pretty helpful.

Monday, March 17, 2008

New Tutorial

Okay so that program wasn't really working, for  reason I don't know.  I decided to go to a different tutorial that was made using XCode 3 that I could follow.  This way I can keep learning about Objective-C and XCode and eventually I'll be able to see what is wrong with the Converter program and be able to fix it.
I started with the tutorial at cocoadevcentral.com and made it through that easily and am now following the other tutorials on C and more advanced Objective-C programming.  These are much easier to follow because they are using the same program as me.

Friday, March 14, 2008

Still not working

I'm still trying to get this Converter program to work.  I've gone all of the way through the tutorial, but when I finished it, there were several discrepancies between the actual program and the tutorial.  So, even following it exactly, the program came up with several errors.  I managed to correct the errors with the limited knowledge I have.  If errors come up in the build process then XCode won't build the program and it can't be run.  So, first I had to get no errors and then the program would build and I could actually try it.  Unfortunately, when I did run it nothing actually happened.  I'm trying to figure out why, because I really have no idea.  It says that the action convert: that I have is not connecting to its target and I'm pretty sure that it is just related to how some of the objects are labeled.  I'm just not sure exactly which labels to change and how to change them, but I'm just trying things out.  It is nice to be able to see the effect of all of the changes I make so even though the program isn't working I can see what everything does when I change it.

Friday, February 15, 2008

XCode 3

Ok so I'm having a little bit of difficulty working through this tutorial.  The problem is that the tutorial, and nearly all of the associated documentation about Objective-C, was created using XCode 2.  So when I am trying to follow along with XCode 3, there are many differences between the two.  The programs are basically the same, but I've found some large differences that make it difficult to follow along.  So much of my time is being spent trying to figure out how to do a task they describe in the tutorial a different way in XCode 3.  The first problem I encountered was with creating classes.  In the Interface Builder I had to create a ConverterController class that would connect the visual elements (Text fields, words, buttons, etc.) with the Converter class that would do the operation of actually converting the numbers and giving a result.  There is a simple Class window pane in XCode 2 that you select and then click on "New Class", this pane is not present in XCode 3.  I did manage to figure out how to create a new class in XCode 3, which has a Library of objects and you can select a generic NSObject from that and then define it further to create a new class.  I am now trying to figure out how to connect this class I have made with the interface that I created earlier, because the methods for doing this are different than the tutorial shows.

Tuesday, February 12, 2008

Currency Converter

Ok so I finished the technology overview.  Now I'm reading a brief tutorial of how to make a Currency Converter.  It goes over the basics of using XCode and Interface Builder, which is Apple's program to make windows and the user interface in an application.  I've started making the very basics of an application by setting up a window with Interface Builder.  So far I havn't used any Objective-C or code because I am just working with the interface.  It shouldn't take too long to finish the Currency Converter and then I'll have something that actually functions as an application.  It seems like the Apple tools are very useful and comprehensive so I don't actually have to do too much coding to make a simple application.  Most of it is visually made.  For instance, to make a text field object that is the result of a conversion done in another class, I don't have to write any code, but simply do a visual drag and drop of a method that connects the results of the class to the selected object.

Monday, February 11, 2008

Mac OS X Technologies

I decided to read the Mac OS X Technology Overview.  It is an overview of the technologies and systems that Mac OS X uses.  I don't understand it all, but it is giving me a good overview of what I am going to be working with when I program with Objective-C.  I read about the underlying frameworks and the Mach kernel.  There are several Core frameworks that I will be using, such as Core Image to create the windows in my applications and display everything that I will need.  I am almost finished reading through that and then I will go back to the Objective-C document and begin trying out some applications myself.

Classes

So I've continued reading about Objective-C 2.0.  Right now I'm learning about classes.  A class is what defines an object and creates an instance of it.  Every class has its own class object, which is an object that is used to create new instances of the class.  It contains all of the information about the class and how the objects the class creates are going to behave.

Monday, February 4, 2008

XCode

I just got XCode 3.  I had to install it and get it setup so I can now use it to program in Objective-C 2.0.  XCode is the programming application for Mac OS X.  I'll now be able to use it to actually make sample programs using Objective-C.  I have to go through some of the basics of using XCode first, but that shouldn't be too difficult.  I'm going to read a little further into Objective-C and then start playing around with XCode to see what I can do with it.

Friday, February 1, 2008

Polymorphism

I'm reading through a PDF on Objective-C 2.0 that I got from the Apple Developer Website.  You have to be an ADC member to view their documents though.  It's like a couple hundred pages though, so it should be a thorough overview of the language.  I can't actually write any code until I get XCode, though, so I have to wait on that before I start developing examples.  So right now I'm just reading through the documentation.  With polymorphism any method that you call on an object such as display could do something different depending on which object it was invoked on.  So if I sent display to an object Square it would call the method display in Square, but this would be a different method than if I called display on the object Circle because a circle would not necessarily be displayed in the exact same way.  So with polymorphism any object could be called to display itself in whatever way it needs to all with the same method call.

Thursday, January 31, 2008

reading

I've just continued reading about Objective-C.  Currently reading about objects and classes because it is an object-oriented language, unlike PHP.  There is a specific data type for an object id.  This is different to try and use and it becomes the default data type when creating new variables.

Tuesday, January 29, 2008

starting

I've started reading about Objective-C 2.0 on the Apple Dev Center website.  I was looking for a language to try and learn and since I own an Apple I guess I'll just see what I can do with the language that Mac programs are made in.  Once I get the basics down I'll start doing some tutorials and making things with XCode.