Simple TTTabBar app troubles

16 views
Skip to first unread message

taco

unread,
Oct 25, 2009, 7:50:40 PM10/25/09
to Three20
I've created a blank UIView App but am getting errors when trying to
build it:

".objc_class_name_TTTabItem", referenced from:
literal-pointer@__OBJC@__cls_refs@TTTabItem in
TestOneViewController.o
".objc_class_name_TTTabBar", referenced from:
literal-pointer@__OBJC@__cls_refs@TTTabBar in
TestOneViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status


Any ideas? Here is the full code of the controller loaded during
startup. I used the "View-based Application".



==================
TestOneViewController.h:
==================

#import <UIKit/UIKit.h>

@interface TestOneViewController : UIViewController {
TTTabBar* _tabBar2;

}

@end



==================
TestOneViewController.m:
==================
//
// TestOneViewController.m
// TestOne
//
// Created by luis on 10/25/09.
// Copyright __MyCompanyName__ 2009. All rights reserved.
//
#import <Three20/Three20.h>
#import "TestOneViewController.h"

@implementation TestOneViewController




- (void)viewDidLoad {
[super viewDidLoad];

_tabBar2 = [[TTTabBar alloc] initWithFrame:CGRectMake(0, 0, 320,
40)];
_tabBar2.tabItems = [NSArray arrayWithObjects:
[[[TTTabItem alloc] initWithTitle:@"Banana"] autorelease],
[[[TTTabItem alloc] initWithTitle:@"Cherry"] autorelease],
[[[TTTabItem alloc] initWithTitle:@"Orange"] autorelease],
[[[TTTabItem alloc] initWithTitle:@"Grape"] autorelease],
nil];
_tabBar2.selectedTabIndex = 2;
[self.view addSubview:_tabBar2];


}




- (void)dealloc {
TT_RELEASE_SAFELY(_tabBar2);

[super dealloc];
}

@end







Thanks.

taco

unread,
Oct 25, 2009, 8:12:58 PM10/25/09
to Three20
I believe this has something to do with not including the Framework.
I've included it now, but I still get the same error.

I also have header search paths pointing to the "src" directory.

taco

unread,
Oct 25, 2009, 8:49:45 PM10/25/09
to Three20
I had messed up on one of these steps. It is working now.


Adding Three20 to your project
==============================

Three20 is compiled as a static library, and the easiest way to add it
to your project is to use Xcode's "dependent project" facilities.
Here is how:

1. Clone the three20 git repository: `git clone git://github.com/joehewitt/three20.git`.
Make sure
you store the repository in a permanent place because Xcode will
need to reference the files
every time you compile your project.

2. Locate the "Three20.xcodeproj" file under "three20/src". Drag
Three20.xcodeproj and drop it onto
the root of your Xcode project's "Groups and Files" sidebar. A
dialog will appear -- make sure
"Copy items" is unchecked and "Reference Type" is "Relative to
Project" before clicking "Add".

3. Now you need to link the Three20 static library to your project.
Click the "Three20.xcodeproj"
item that has just been added to the sidebar. Under the "Details"
table, you will see a single
item: libThree20.a. Check the checkbox on the far right of
libThree20.a.

4. Now you need to add Three20 as a dependency of your project, so
Xcode compiles it whenever
you compile your project. Expand the "Targets" section of the
sidebar and double-click your
application's target. Under the "General" tab you will see a
"Direct Dependencies" section.
Click the "+" button, select "Three20", and click "Add Target".

5. Now you need to add the bundle of images and strings to your app.
Locate "Three20.bundle" under
"three20/src" and drag and drop it into your project. A dialog
will appear -- make sure
"Create Folder References" is selected, "Copy items" is unchecked,
and "Reference Type" is
"Relative to Project" before clicking "Add".



6. Now you need to add the Core Animation framework to your project.
Right click on the
"Frameworks" group in your project (or equivalent) and select Add >
Existing Frameworks.
Then locate QuartzCore.framework and add it to the project.

7. Finally, we need to tell your project where to find the Three20
headers. Open your
"Project Settings" and go to the "Build" tab. Look for "Header
Search Paths" and double-click
it. Add the relative path from your project's directory to the
"three20/src" directory.

8. While you are in Project Settings, go to "Other Linker Flags" under
the "Linker" section, and
add "-ObjC" and "-all_load" to the list of flags.

9. You're ready to go. Just #import "Three20/Three20.h" anywhere you
want to use Three20 classes
in your project.
Reply all
Reply to author
Forward
0 new messages