V4CC - Can't work with class way
Ernesto Giannotta
ernestogiannotta at tiscalinet.it
Sat Aug 22 16:37:15 CDT 2009
Hi Ruslan,
I'm trying reproduce the V4RB Table_Create (class way) example with
V4CC, but no luck :-(
First problem, if I override the init of VTable like this:
@implementation tblPerson
-(id)init
{
self = [super initWithName:@"Person"];
I get caught in an infinite recursive loop:
#0 0x0009fbda in -[VTable initWithName:]
#1 0x000041f5 in -[tblPerson init] at tblPerson.m:16
#2 0x0009fbec in -[VTable initWithName:]
#3 0x000041f5 in -[tblPerson init] at tblPerson.m:16
It seems that [super initWithName:] calls [self init] but should call
[super init]...
Ok, I try to workaround this and use non standard initializer name:
@implementation tblPerson
-(id)initTable
{
self = [super initWithName:@"Person"];
if (self) {
mfFirstName = [[VString alloc] initWithName:@"fldFirstName" length:40
flags:0 method:nil];
mfLastName = [[VVarChar alloc] initWithName:@"fldLastName" length:
2000 flags:0 method:nil];
mfBornDate =[[VDate alloc] initWithName:@"fldBornDate" flags:0
method:nil];
}
return self;
}
@end
this seems to work, but when I try to access the Table properties I
find myself in a dead end:
#0 ??
#1 0x0009d964 in -[VTable name]
#2 0x00004380 in -[tblPerson initWithName:] at tblPerson.m:28
#3 0x00004201 in -[tblPerson initTable] at tblPerson.m:16
#4 0x0000415e in -[DbContacts init] at DbContacts.m:18
The line executed in the [VTable name] call is here in red:
0x0009d913 <+0005> call 0x9d918 <-[VTable name]+10>
0x0009d918 <+0010> pop %ebx
0x0009d919 <+0011> sub $0x20,%esp
0x0009d91c <+0014> mov 0x8(%ebp),%esi
0x0009d91f <+0017> movl $0x0,0x4(%esp)
0x0009d927 <+0025> lea 0xff22(%ebx),%eax
0x0009d92d <+0031> mov %eax,(%esp)
0x0009d930 <+0034> call 0x95ffa <_ZN3fbl9log_startEPKci>
0x0009d935 <+0039> lea 0xb644(%ebx),%eax
0x0009d93b <+0045> mov %eax,0x4(%esp)
0x0009d93f <+0049> lea 0xdfb4(%ebx),%eax
0x0009d945 <+0055> mov %esi,0x8(%esp)
0x0009d949 <+0059> mov %eax,(%esp)
0x0009d94c <+0062> call 0x95c08 <_ZN3fbl9log_paramEPKcS1_PKv>
0x0009d951 <+0067> mov 0x4(%esi),%eax
0x0009d954 <+0070> xor %esi,%esi
0x0009d956 <+0072> mov (%eax),%edx
0x0009d958 <+0074> test %edx,%edx
0x0009d95a <+0076> je 0x9d986 <-[VTable name]+120>
0x0009d95c <+0078> mov (%edx),%eax
0x0009d95e <+0080> mov %edx,(%esp)
0x0009d961 <+0083> call *0x18(%eax)
0x0009d964 <+0086> mov %eax,(%esp)
0x0009d967 <+0089> call 0xcd338 <dyld_stub__ZNK3fbl6String5c_strEv>
0x0009d96c <+0094> movl $0xffffffff,0x8(%esp)
after that only dark...
Cool Runnings,
Erne.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macserve.net/pipermail/valentina/attachments/20090822/2137f7bd/attachment.html
More information about the Valentina
mailing list