AlexDenisov / iActiveRecord

ActiveRecord for iOS without CoreData, only SQLite
http://alexdenisov.github.com/iActiveRecord/
MIT License
354 stars 50 forks source link

errors building on XCode 5.1 #55

Open gsoro opened 10 years ago

gsoro commented 10 years ago

Hi, i'm having a series of issues (see image attached) trying to build the framework on XCode 5.1. Have you managed to build for ios7/code 5 or is it still on the run?

Thanx G. schermata 2013-10-31 alle 13 46 06

AlexDenisov commented 10 years ago

I will check this asap, thank you.

jklimke commented 10 years ago

Hi,

i ran into the same problem with XCode 5 and MacOS Maverick 10.9.

I solved it by adding the Foundation framework as target link dependency of the ActiveRecord lib project and add the follwoing includes to IColumnInternat.h

#include <cstring>
#include <memory>
#import <Foundation/NSString.h>

Since i don't know wether it makes sense to add the framework to a static lib, i did not create a pull request.

jklimke commented 10 years ago

Hmm, i hope to have this one fixed, but unfortunately a linking problem appeared saying:

Undefined symbols for architecture i386: "vtable for AR::NSNumberColumn", referenced from: AR::NSNumberColumn::NSNumberColumn() in ActiveRecord NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

i double checked the virtual methods of AR::NSNumberColumn are implemented within the iActiveRecord source. Any ideas what could possibly the reason for this ?

AlexDenisov commented 10 years ago

Hello, guys. I've added small fix, and now it works on my machine as well. Could you check is this issue still exists?

jklimke commented 10 years ago

Hi, i tested it with building my own application and integrating the generated framework (not via podfile). It turns out that nothing changed for me. I still get the error above when i try to link my project.

In contrast, you active twitter example compiles and works well.

AlexDenisov commented 10 years ago

It's quite strange. btw, ActiveTwitter uses CocoaPods...

jklimke commented 10 years ago

Yeah, i noticed that an tried to use the podfile that is included within the project. At least this compiling now.

Now i got another issue. This could originate from my code.

that is the runtime exception i get:

exception 'NSInvalidArgumentException', reason: '-[Topic setDescription:]: unrecognized selector sent to instance 0xa124b10'

Topic is defined as

#import <ActiveRecord/ActiveRecord.h>

@class Contact;
@class ContactGroup;

@interface Topic : ActiveRecord

@property NSString* title;
@property NSString* description;

has_many_through_dec(Contact, ContactGroup, contactGroups, ARDependencyNullify)

@end

and implemented like this:

@implementation Topic

@dynamic description;
@dynamic title;

has_many_through_imp(Contact, ContactGroup, contactGroups, ARDependencyDestroy)

@end

is there maybe any kind of initialization i have to run on application startup ? or is this done automagically ?

AlexDenisov commented 10 years ago

Yep, you should add initialization somewhere (applicationDidFinishLaunching the best point), just review the ActiveTwitter target.

jklimke commented 10 years ago

This, in connection with the usage of the podspec file seems to work. Thanks a lot for your help.