Wednesday, October 03, 2007

Des Moines CocoaHeads: All about Quartz

The next CocoaHeads meeting will be close to home in Ames @ Iowa State University. I will be giving a presentation about Quartz and specifically using it with Cocoa. Once the meeting is up I will post the Keynote presentation and source code so you can download it. Reposted from http://cocoaheads.org/us/DesMoinesIowa/index.html

The next CocoaHeads: Thursday October 11, 2007 07:00 PM CST at Howe Hall, Room 1246 - Iowa State University Campus. Directions: Howe Hall is located on the north-west corner of Bissell Rd and Marston Ct Ames, IA 50014 [map] "[Howe] is a big building, glass front, you can't miss it". Parking is available in lots north or south of Howe. [parking options] Agenda: Intro to Quartz: a discussion of the more advanced drawing routines available in Cocoa. And as always, general Cocoa geekyness.

Monday, September 10, 2007

Des Moines CocoaHeads in Ankeny & Contact Info

Info reposted from http://cocoaheads.org/us/DesMoinesIowa/index.html Schedule: The next CocoaHeads: Thursday September 13, 2007 07:00 PM CST at Kirkendall Public Library. Directions: 1210 NW Prairie Ridge Dr Ankeny, IA 50023 [map] Note that this is a new location as Panera was a bit noisy. Internet access is available, but the librarians tell me it can be "spotty" in the room we'll be in. Agenda: We'll be building a very basic app with XCode and Project Builder to get those who are a little green to the process some idea on how to start. This will undoubtedly progress into Advance tips and tricks as well as a discussion on Objective-C's finer points. We should also have time to discuss any issues people may be having or have overcome (I'm looking at you, Colin:) And as always, general Cocoa geekyness. You can also find the Des Moines CocoaHeads @ http://groups.google.com/group/des-moines-cocoaheads ============== Also wanted to let you know that i've setup a GMail account for e-mail regarding questions of things on this blog, general cocoa topics,etc. The address is on the sidebar to the right. You can email me at cocoasamurai@gmail.com.

Wednesday, August 22, 2007

An Open Letter to Apple

Every time Apple releases a new version of Mac OS X, Developers get shafted a little bit. We develop the apps that complement and enhance Mac OS X and make it great and what do we get for this? Releases of Mac OS X about a month after everybody else. It’s no secret that with paid ADC accounts we get a free copy of Mac OS X as it’s stated clearly on the ADC Site ( http://developer.apple.com/products/ ), which is why anybody who knows they are getting a free copy wouldn’t buy one. Well I am not here to endlessly bitch about it, I am here to provide an easy to implement solution... certificates. I propose instead of letting developers sit by waiting for Leopard to come a month late and let everybody else get a copy of Mac OS X Leopard when it comes out right away, let developers sign up on the ADC site for certificates for a specific Apple store if you want it. Instead of mass mailing out these certificates to every developer (wether they will be at a Apple store or not, thus potentially leading to some abuse of the system) open a form on the ADC site that checks our credentials (knowing if we have an account with a free copy of Mac OS X (Select, Premier or Student ) or not), and then lets say the form can contain the Apple Store we plan to go to and then give us a printable (or mailed to us) certificate that when we go to the Apple store on Leopards launch date we can redeem for a copy of Leopard. I am guessing that due to the close time frame of Leopard in October it’s probably too late to create this so that certificates are mailed to us. So I suggest this

  1. Create a Section on the ADC site that lets developers sign up for a printable certificate (optionally with a serial code pattern unique to the particular apple store) to be redeemed at a specific Apple Store for Mac OS X Leopard
  2. This form validates our ADC account and when it’s all submitted sends this information to the specific Apple store. 
  3. When Mac OS X Leopard launches developers print this certificate out and go to the Apple store
  4. When at the apple store the employees scan a barcode on the certificate or enter in some unique serial number/code and in combination with a simple thing like our drivers license for ID, validates us and takes the full price off of leopard and thus developers get a copy of Mac OS X 10.5 Leopard! :D
Thus Developers are happy! We get Mac OS X Leopard at the same time as everybody else, like it should be, and don’t have to wait a month to get it in the mail. Everybody wins! I realize that perhaps I haven’t thought every detail of this out, but it seems entirely plausible to me to have some system in place so developers who are genuinely entitled to a free copy of Mac OS X because of their paid ADC account can go to the Apple Store and pick up a copy the same day as everybody else. Heck I’d pay a small fee for the convenience of picking it up the same day as everybody else. Like I said this is just a suggestion, but I think as a developer instead of endlessly complaining about it we should put forward solutions to this problem and appropriately communicate them to Apple. The main reason I post this here is because I think there needs to be some open debate about this long before Apple publishes Leopard and we hear the moans of developers waiting for their copy of Mac OS X to arrive, the only alternative to this that I can see at the moment is for Apple to mail our copies of Mac OS X to us early (but then they could not really ensure AFAIK that the mail system only delivers them to us on the appropriate date all at once.) What does everybody else think about this?

Wednesday, July 18, 2007

CocoaHeads starting up in Des Moines!

Bout time! :D The first meeting of CocoaHeads chapter in Des Moines, Iowa is starting up. Im planning on attending and if your in the area come on by! When: August 2 @ 7-9pm Where: Panera Bread on 86th in Urbandale Google Maps Link Why: Meet local Cocoa developers like you who want to know more about Cocoa and voice your opinion about what you'd like to learn about in future meetings

Thursday, June 07, 2007

Make the most of your time @ WWDC

Well I am not going to WWDC this time around. But chances are if you are reading this you are... or at least you just wanna know what all the fuss is about. Scott Stevenson posted his thoughts on CocoaDevCentral and as a first time attendee I thought i’d give you some tips from things I learned at WWDC 06. Students Generally speaking students get the Sunday before the Keynote to go through a few general sessions by some guest speakers, followed by a Dinner and Job Fair. But lets get the ugly out of the way. Get there Saturday with a good amount of time to get the lay of the land. I don’t know about WWDC 07 but in 2006 the Student session was at a hotel and not at the Moscone center. So you’ll need to know where the student session is at and how to get there. If you can print out as many copies of your resume (assuming your going to the career fair) before leaving on the trip, or find a copy place on Saturday and save yourself some time. You should have a good amount of time on Sunday before the career fair to do this, but I would rather have spent the time relaxing. Also you’ll need to get your badge you wear all around WWDC on Saturday at the Student Registration. You can always get this later, but I would really recommend getting your badge on Saturday. When you start out Student Sunday feel free to bring your MacBook/Pro to take notes, etc. Then you’ll have your sessions as well as lunch then the Career Fair. Many students ask about the attire you wear to the career fair. In general most people going wear formal clothes, but you are totally free to chose what you want. Your not required to go formal. The Keynote and First Day Again for the rest of the WWDC attendees, get your badges ahead of time before Monday. Just trust me, it’ll save you lots of time and effort later on. Scott was right about the Keynote comparison between WWDC and MacWorld. I woke up at 6 am and got there 7 am and the line was from the front of the building and wrapped around roughly a block. When I finally got in to the keynote room, I got a spot only a few rows back from the frontmost spot the average attendee could get. In comparison I read about how people camped out the night before MacWorld. Overall get there at whatever time you want, but if you want a really good spot then get there at around 6-7 am, if you want any decent spot I wouldn’t get there more than a couple hours after that. Then you can watch the keynote and break for lunch. After that you’ll go through a couple State of the Union sessions followed by dinner at a reception there. The Sessions Apple makes a list of sessions available ahead of time, but many of them are blank for unannounced sessions. All I can offer you here is mark out which sessions you’d like to go to ahead of time. When they finally do announce all the sessions, all you need to do is compare your selection against the newly announced sessions and make your choice. You can always go for a session in something your interested in learning vs learning how something has improved in the next Mac OS. Personally i’d always go for something new if you can as they paid off big for me, but again it’s all your choice. If say your job revolves around some particular feature/topic then certainly go to the sessions on that. You can always watch the video of the session later on. Hands on Sessions Whereas most sessions are like listening to a lecture/guide to how something works, the hands on sessions are more tutorial-like than anything else. The one hand on session I went to was nice, but at the same time it’s wasn’t required you even follow along to enjoy it. Apple will probably provide code ahead of time on the WWDC attendee site. If you are even thinking of going to these sessions I’d personally take the time and download the code/files for the sessions ahead of time so you have them in case you go to the session. Labs Labs are a nice time to get some one on one time with apple engineers to get answers to your tough problems. If you intend to go to these have your laptop with you and a list of things you are trying to get help on. In many sessions you are attending you should pay attention to any mentions of specific times for a lab on that subject so that you can make the maximum use of your time at WWDC. Feedback Forums Feedback Forums are a very loosely structured meeting. Basically key people from Apple that work on whatever the forum is focused on are on stage and take your feedback on that subject wether it’s good or bad, or if you just want to offer advice on things you think apple really needs to include/improve in whatever the forum is focused on. These sessions are ok, but aren’t really that useful to you unless you really want to give apple some feedback. Special Events There are 3 special events definitely worth attending at WWDC. The first being the Apple Design Awards where developers get recognized for producing some amazing apps. Each time this is held the competition keeps growing in size. The other event is stump the experts. This one is an event they even encourage you to take all the pictures you want. It’s overall a very good time to be had trying to solve the puzzles they put up and all the questions. Too bad theres no video of this on the ADC on iTunes. The last event is the Bash on Apples Campus. If you want to get a decent spot, be sure to line up early. Me and my friends did and we got to be among the first to get in line for the Apple Store there and it still took a while to get in there. If you get there and see a long line it may not be worth it to even try and get in. They have plenty of food and drinks there as well as a musical guest of some sort. WWDC 06 featured a DJ, it sounds like 05 featured a band ( Jimmy Eat World.) Meals Everyday Apple has Breakfast and Lunch for all attendees as well as dinner on a few nights. It seemed to me that there was generally plenty to eat there at any given time. There was even enough laying around just before the keynote to make a decent breakfast. As for lunch, I can’t speak to everybody’s taste, but I found there was a decent variety. Usually there are a few options at any meal and I believe there was some vegetarian meals, but I didn’t pay much attention to them while I was there. As always there are options for meals around you in San Francisco, but mostly they seem a bit expensive and so most of my meals were at the Moscone Center.Also there is always (and I mean ALWAYS) a ton of free drinks in the commons area of each floor (except the 1st floor.) By drinks I mean lemonade, water, etc. Overall Overall just relax and have a good time there. Unless you really need help at the labs with specific topics just go with what seems interesting to you and never second guess yourself, you can always watch the video of the session you couldn’t go to later on when Apple puts it up for download on iTunes. Enjoy yourself at WWDC! Also let me know if there was anything else you thought was important from your experiences at WWDC.

Monday, June 04, 2007

OMG iPhone SDK!!!

Well the Mac News & Rumor sites are abuzz with news of a potential iPhone SDK at WWDC 07. Personally I never know what to trust when these types of rumors come out. I do believe though that there is usually an element of truth behind the rumors. Since writing my original iPhone SDK analysis shortly after Steve’s keynote i’ve had some time to reflect on this and I must say I still stand by it. To quickly recap here are some observations I made

  • There are no Windows in the iPhone, the entire system appears to revolve around presenting and animating views
  • The sheets that animate onto existing views appear to only come from the bottom-up as seen in the keynote
  • all views and layers appear to have the ability to become partially transparent including the toolbars and topmost statusbar
  • The iPhone shows the same cocoa controls we know with some sporting some theming to blend in with
  • the iPhone UI, these controls include NSButton, NSSegmentedControl, NSSearchField, NSToolbar, etc
  • The keyboard sheet will probably be a standard sheet you can call for input from any app, gone will be the days where we simply assume users can type something at any time
If the iPhone SDK does actually show up at WWDC then many questions developers have been curious about will finally be answered. Apple likes to keep their apps short and simple, especially on the iPhone so it makes it difficult to try and predict the full range of such a SDK. John Gruber thought that the iPhone SDK would simply take time to document before it could be released to developers and thus the comments made by Steve Jobs are simply just irrelevant and hide the fact that they may still be preparing the SDK for public consumption, a thought seconded by boredzo. Which makes sense to me, after all the reporters who managed to get some play time with the iPhone after the keynote stated that at some points they thought they broke the iPhone because no controls responded and found out that what they were looking at was only an image instead of some finished apps. Even if software was finished there it would still take some time to document to any decent degree. Something Im surprised that’s never been mentioned anywhere is a good theory for how to develop software for the iPhone. After all gone will be the days of a single toolbar, one mouse, a floating palette, etc. This isn’t Windows Mobile, this is Mac OS X Mobile dammit! Where are the big discussions at? Even in the absence of a official SDK, we could all make some general assumptions and guidelines with the views, and buttons we saw in the keynote alone. Maybe a better question is that if the Windows Mobile based phones suck so much what can we learn NOT to do from them? Unfortunately this is something I feel I can’t adequately answer here as i’ve never used a smart-phone with windows mobile yet, the best phone I’ve owned so far is my current Motorola RAZR V3m that’s been locked down by verizon. Thankfully it syncs with iSync, or I should say did. It now experiences bugs syncing and forces me to go from syncing once a month to once every couple weeks due to a stupid calendar issue of some sort. In any case every phone I’ve ever used has utterly sucked in my opinion. Entering alarm times, looking up events in my calendar all utterly suck and the fact that Verizon has locked it down doesn’t help at all. Another thing that people haven’t explicitly discussed is the impact of some particular features in the iPhone on the SDK. If the iPhone has Core Animation then it should be generally assumed that it’s based off of Mac OS X 10.5 Leopard unless apple did a major job of back porting Core Animation to 10.4 Tiger which I very much doubt. So that also means we also have garbage collection which makes a lot of sense for the iPhone as it won’t exactly be an expandable environment. Some developers have been wondering about how we handle the multiple mouses thing. Personally Im not worried about simple operations such as zooming in views. I think that may be handled by simply having your view do drawing triggered by delegate methods. What Im wondering is things like how we track the changes on the UI by 2 mouses, like if we have 2 sliders and the user decides to operate on both of them at the same time. Or can I use 1 mouse to let a user browse a list and another one to trigger that list to scroll faster/more slowly,etc? A point brought up by comments on the previous iPhone article thought several things might happen for the developer tools like anything from a whole new Xcode to just a simple iPhone emulation app. Personally I’m going with the 2nd option. I think it wouldn’t be in Apples interest to create a whole Xcode for the iPhone, but rather to create an iPhone project category and to possibly limit what you can do in Interface Builder under this special mode. Lastly one BIG thing nobody’s mentioned is that this SDK may be very limited at first. If the SDK is presumed to work with Leopard features, then that should limit running the iPhone SDK to Leopard as well under a...oh say new beta of leopard distributed at WWDC. Overall I’ll say this. I don’t think it’s outside the range of possibility to see an iPhone SDK introduced at WWDC or at the very least to see one announced and shipped later on after WWDC. I have the day off work for Steve Jobs keynote and unfortunately I am not going to WWDC so I will have to watch the feeds same as many of you.

Monday, April 30, 2007

Wahoo! Finals are over! :: Book & QuietLog

Finals are finally done with, all my big projects are over with, all my homework is turned in I can refocus all my energy again!!! :D Don't' get me wrong I like learning in detail about algorithms and some finite math, but after a few months of doing big projects it gets tiring very fast. Most importantly im gonna get back on track on writing here regularly. Advanced Cocoa Book I don't usually give my thumbs up to something that I haven't completely gone through yet, but i've gotten about halfway through Aaron Hillegass and Mark Dalrymple's Advanced Mac OS X Programming and already I love the book. It's the first Mac Developer book I've personally read that doesn't treat you like a complete newbie to Macintosh Development and instead shows in great detail how Mac OS X works and will even show you some nice unix tools you didn't know existed that can actually be of great help to you. The book covers various topics such as Multi-threading, Interprocess Communication, Networking, Performance Tuning, kqueues, Bonjour, Authentication, Keychain, GCC, GDB, memory management, etc. Really this book is a fantastic book that I would really recommend to all Mac developers out there. It starts you right off showing you in detail how you can work with gcc then goes into libraries, gdb, memory and more. Thank you Aaron and Mark for putting together such a great book! QuietLog I also wanted to share something with you that I posted in my personal blog a while ago and recently I've learned it's value as I begin to really use it in my serious projects. And I found it on Borkwares quickies site. To be honest I'm not sure how I came across Borkwares quickies site but I'm glad I found it, if you haven't been there take a minute and open up another tab and go there after you see this. One problem I have with NSLog is that it can provide you with a ton of information when you just want to print simple statements. Printf can be useful, but it can't handle Objective-C objects. So that's what QuietLog is for...

void QuietLog (NSString *format, ...) { // get a reference to the arguments on the stack that follow // the format paramter va_list argList; va_start (argList, format); // NSString luckily provides us with this handy method which // will do all the work for us, including %@ NSString *string; string = [[NSString alloc] initWithFormat: format arguments: argList]; va_end (argList); // send it to standard out. printf ("%s\n", [string UTF8String]); [string release]; } // QuietLog
It's a nice method that can handle objective-c objects and print them out in a simple manner, you won't notice any difference except the all the preceeding junk you didn't care about. To implement this in a way you can use throughout all your project you just need to do it like so... QuietLog.h
#import < Cocoa/Cocoa.h > extern void QuietLog (NSString *format, ...);
QuietLog.m
#import "QuietLog.h" void QuietLog (NSString *format, ...) { // get a reference to the arguments on the stack that follow // the format paramter va_list argList; va_start (argList, format); // NSString luckily provides us with this handy method which // will do all the work for us, including %@ NSString *string; string = [[NSString alloc] initWithFormat: format arguments: argList]; va_end (argList); // send it to standard out. printf ("%s\n", [string UTF8String]); [string release]; }
And then import the QuietLog.h anywhere you actually need it and now you have a nice utility to use in your projects. If your curious about the va_* stuff you can find more info here http://www.delorie.com/gnu/docs/glibc/libc_675.html, the va_list is a type that's part of the GNU C Library for obtaining info about the arguments used in calling the method. I could go on more about this but you can read the GNU page if you want to know more about it. Thats it for now. I have some free time now that I have roughly a month free from school and can work on my new pet project RedFlag (hopefully to be a great and elegant Del.icio.us client) and post some more great stuff I've discovered. See you soon! :D

 
...