喜的朋友我已经在控制台消息(它不给错误或警告)只显示消息 这就像得到的消息只是内存泄漏
__NSAutoreleaseNoPool(): Object 0x6378190 of class HGMapPath autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x6379e00 of class HGMovingAnnotation autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x578f2e0 of class __NSCFSet autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790a00 of class __NSDate autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790ab0 of class __NSCFTimer autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x6348c90 of class UIView autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x633fb60 of class UILayoutContainerView autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x6379c10 of class __NSArrayI autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790e20 of class MKDirectionsRouteInfo autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x6371a40 of class MKDirectionsRouteInfo autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x63799c0 of class NSCFString autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x6371e30 of class NSCFNumber autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x636d850 of class NSCFNumber autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790cf0 of class __NSArrayI autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790d10 of class __NSArrayI autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790e90 of class NSCFNumber autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790d30 of class NSCFNumber autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790d40 of class NSCFNumber autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790d50 of class NSCFNumber autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790d60 of class NSCFNumber autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790d70 of class NSCFNumber autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790d80 of class NSCFNumber autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790d90 of class NSCFNumber autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x6379b40 of class __NSArrayI autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x6375300 of class CABasicAnimation autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790b40 of class CABasicAnimation autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790ed0 of class NSCFNumber autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x5790ee0 of class NSCFNumber autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x634d210 of class CABasicAnimation autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x6379b60 of class CABasicAnimation autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x637b870 of class __NSCFDictionary autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x6371960 of class NSThread autoreleased with no pool in place - just leaking
我只是想知道为什么它正在发生。就是消息它会在未来造成问题。我可以如何解决这个问题我建议使用这个代码来解决这个问题。
//start tracking vehicle locations. In DEMO mode just read locations from the path...
- (void) start
{
[self performSelectorInBackground:@selector(startTracking) withObject:nil];
}
- (void) stop
{
[NSObject cancelPreviousPerformRequestsWithTarget:self];
self.isMoving = NO;
}
- (void) startTracking
{
self.isMoving = YES;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
for(int i=_currentPathPointIndex+1; i<path.pointCount; i++)
{
currentLocation = self.path.points[i];
_distanceTravelled += MKMetersBetweenMapPoints(self.path.points[i], self.path.points[i-1]);
//send notification
[[NSNotificationCenter defaultCenter] postNotificationName:kObjectMovedNotification object:self];
[NSThread sleepForTimeInterval : DEMO_SPEED];
}
//finished moving along the path - send notification
[[NSNotificationCenter defaultCenter] postNotificationName:kObjectRechedEndOfPathNotification object:self];
[pool drain];
}
在此先感谢
请正确格式化您的代码。 – 2011-05-12 05:53:50