Q: uilabel setcenter crashes I am trying to do this on my iphone application.
[titleLabel setCenter:[self.navigationItem.titleView center]];

titleLable is UILabel.
I dont know why the heck it is crashing for few title texts. For a set of texts it is not crashing where for other set of texts it is crashing. iOS 4.3.1 device / build using iOS 4.2 SDK
What could be wrong ?
*forgot to add the most important thing. This happens when i build the app with my distribution license and not with the developer license. Will the license have an impact on this stuff *
0   libsystem_kernel.dylib          0x35523a1c __pthread_kill + 8
1   libsystem_c.dylib               0x33f3c3b4 pthread_kill + 52
2   libsystem_c.dylib               0x33f34bf8 abort + 72
3   libstdc++.6.dylib               0x33a6ca64 __gnu_cxx::__verbose_terminate_handler() + 376
4   libobjc.A.dylib                 0x348a106c _objc_terminate + 104
5   libstdc++.6.dylib               0x33a6ae36 __cxxabiv1::__terminate(void (*)()) + 46
6   libstdc++.6.dylib               0x33a6ae8a std::terminate() + 10
7   libstdc++.6.dylib               0x33a6af5a __cxa_throw + 78
8   libobjc.A.dylib                 0x3489fc84 objc_exception_throw + 64
9   CoreFoundation                  0x3361c48a +[NSException raise:format:arguments:] + 62
10  CoreFoundation                  0x3361c4c4 +[NSException raise:format:] + 28
11  QuartzCore                      0x34edd616 CALayerSetPosition(CALayer*, CA::Vec2<double> const&, bool) + 134
12  QuartzCore                      0x34edd584 -[CALayer setPosition:] + 32
13  UIKit                           0x35661364 -[UIView(Geometry) setCenter:] + 16
14  myapp                           0x0000e3fa -[Headings viewDidLoad] (Headings.m:188)

at 188 is the code which is placed in the starting of the question

A: Try wiht this syntax:
titleLabel.center = self.navigationItem.titleView.center;

If it doesn't work your UILabel is nil. Try:
UILabel *titleLabel=  [[UILabel alloc] initWithFrame: self.navigationItem.titleView.frame];


A: First guess, is titleView nil?
Otherwise, XCode should be giving you the name of an error.  Maybe you can figure it out from there.  Or post the error message here so others can look at it.

A: i got that damn thing fixed . . xcode 3.2.5 . .changed the compiler setting to gcc llvm . .it started working ;)
