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

MrFusion

macrumors 6502a
Original poster
Jun 8, 2005
613
0
West-Europe
Hi everyone,

I just switched to leopard (finally bought an iMac 24" after hesitating for a year). My next goal is to get more familiar with the new developer tools themselves, instead of figuring out cocoa.

As a first step, I want to create my own framework and import it in another project.
I found this doc.
http://developer.apple.com/document...al/BPFrameworks/Tasks/CreatingFrameworks.html

Either it's very confusing or it's very late in the evening. :)
For example, this line can be found in the doc:
"Although you can tell Xcode to install your framework in its final deployment location, during development you may want to leave it where it is."
That sounds great, but how exactly do I tell Xcode to install the framework in its final deployment location?

I have found the documentation, but is there also a step by step version for dummies? I just want to create the most basic framework and import it in the most basic cocoa app. For all I care it prints out "Hello world", as long as the concept of private frameworks becomes clear to me.

Thank you in advance for the replies!
 
Some progress

There is some progress in my understanding of including frameworks, but it's not yet working unfortunately.

I found these helpfull links:
http://rentzsch.com/cocoa/embeddedFrameworks
http://panthermodem.com/blog/?page_id=174
https://forums.macrumors.com/threads/552585/

After unsuccessfully trying to correct my attempts of yesterday, I followed the video in the first link.

In the framework I changed the
installation directory
to
@executable_path/../Frameworks
and added
-seg1addr 0xb0000000 -framework Foundation -framework AppKit
to
other linker flags.

In the client app, I added a new build phase to copy files, with destination set to frameworks.
I added the framework to linked frameworks, and copied this into the new build phase folder under the app's target.

Doing all this solved some problems, but created a new one:
pbxcp: warning: couldn't strip: /Users/MrFusion/Developer/Testing/app3/build/Release/app3.app/Contents/Frameworks/MyFramework.framework/Versions/A/MyFramework: No such file or directory

I went a few times through the video, even started twice from nil. I am not sure where I deviated from it to cause this error, or how I am supposed to correct it.

All help will be appreciated.
 
Why would you think making a framework is easier than earning a little Cocoa (Objective-C)?

There's tons of simple little examples in Developer -> Examples to look at it without having to learn Framework-making voodoo.
 
Why would you think making a framework is easier than earning a little Cocoa (Objective-C)?

There's tons of simple little examples in Developer -> Examples to look at it without having to learn Framework-making voodoo.

I want to learn framework voodoo, because I am getting tired of having to copy my graphing "framework: to each and all of my other programs. I am also starting to loose track of which program has the most recent version of my graphing code. Cocoa doesn't have a library for plotting and I didn't like any of the other frameworks in the wild, so I build my own. I know enough about alloc, dealloc, pointers and caching in order not to crash my program, when I try to plot over 2000 datafiles.
I know how to use coredata. I figured out how to use document based apps with support for different filetypes, with each filetype having its own nib file. I know how to build and run command line programs. I figured out how to convert binary files to ascii, although lucky I had the documentation so that I know the meaning of each byte. At some point or another, I used pretty much every gui-object from interface builder. I have dabbled with drag and drop. I know how to read and write files. I know how to use categories and protocols, or import and use third party plain c code (gsl). Structs are another thing I have some grasp off.

I don't yet know obj-c 2.0, instruments, xCode 3.0, interface builder 3.0 (because I just switched to Leopard). I also don't know how to take advantage of frameworks, although I think I am pretty close. I also don't know much about software design and algorithms.
I did not study computer science. While I know enough about cocoa to make a few nice usable programs for myself, compared to people with an IT degree my programming skills are laughable. The only formal computer class I had was programming with pascal.

I could probably spend another 2 years at learning more cocoa classes, but figuring out all these frameworks and targets stuff in xCode is also part of the learning process. I don't think frameworks are easier of more difficult than cocoa, but at this point learning frameworks has the biggest advantage for me.

BTW, all I know about xCode and cocoa is thanks to the apple docs, http://www.cocoadev.com/ and especially you guys and girls. Thanks for that, and my apologies if I don't always contribute much back, or sound a little harsh.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.