我有一段时间没有注意到我的控制台输出,我突然发现很多奇怪的错误.
__NSAutoreleaseNoPool(): Object 0x753c2f0 of class General autoreleased with no pool in place - just leaking
__NSAutoreleaseNoPool(): Object 0x753c300 of class __NSArrayM autoreleased with no pool in place - just leaking
我不知道这发生了什么?
编辑..
我用这个
[self performSelectorInBackground:@selector(startupStuff) withObject:sender];
Run Code Online (Sandbox Code Playgroud)
随着statupStuff我有这个
General *rdb = [[General alloc] autorelease];
[rdb refreshDBData];
Run Code Online (Sandbox Code Playgroud)
错误发生在refreshDBData方法中的代码之后不久.
我已经问了一个类似的问题,但我仍然看不出问题?
-(id)initWithKeyPadType: (int)value
{
[self setKeyPadType:value];
self = [self init];
if( self != nil )
{
//self.intKeyPadType = value;
}
return self;
}
- (id)init {
NSNumberFormatter *formatter = [[[NSNumberFormatter alloc] init]
autorelease];
decimalSymbol = [formatter decimalSeparator];
....
Run Code Online (Sandbox Code Playgroud)
警告来自上面的一行 Instance variable used while 'self' is not set to the result of '[(super or self) init...]'
我需要将一些数据放入文件中,但我希望确保数据保持不变.来自损坏或修改文件的用户.
有人能指出我正确的方向,如何将校验和添加到文件,读取/检查文件是否正确?
我在界面构建器中使用我的IB_DESIGNABLE属性集显示了我的视图,但是当我使用预览功能查看我的视图在各种设备上的外观时,我只获得超级视图名称,例如UIView.
请勿IB_DESIGNABLE在预览中显示视图?
编辑按要求的代码+屏幕截图:
H
=
#import <UIKit/UIKit.h>
IB_DESIGNABLE
@interface TitleBannerView : UILabel
@property (nonatomic) IBInspectable CGFloat borderWidth;
@property (nonatomic) IBInspectable CGFloat cornerRadius;
@property (nonatomic) IBInspectable CGFloat shadowHeight;
@end
M
=
@implementation TitleBannerView
@synthesize borderWidth;
@synthesize cornerRadius;
@synthesize shadowHeight;
- (void)drawRect:(CGRect)rect {
if (self.borderWidth == 0) self.borderWidth = 8.5;
if (self.cornerRadius == 0) self.cornerRadius = 33;
if (self.shadowHeight == 0) self.shadowHeight = 15.1;
CGContextRef context = UIGraphicsGetCurrentContext();
//// Color Declarations
UIColor* bG = [UIColor colorWithRed: …Run Code Online (Sandbox Code Playgroud) 我正在创建一个可可触摸框架来在我的应用程序之间共享一些通用代码。
我需要将一个类的实例传递给一个方法,该方法具有一些特定的属性。
该方法将从应用程序中调用。
我对使用协议很陌生。
我是否应该在我的框架中创建一个协议 h 文件,其中包含该函数所需的所有属性。
如果是这样,我可以将协议作为实例变量的类型传递给函数吗?
如果不是怎么能做到这一点?
我收到了这个警告.
'-respondsToSelector:'在协议中找不到
它出现在下面标有"HERE"的行上.
- (NSString *)tableView:(UITableView *)tableView
titleForFooterInSection:(NSInteger)section {
id<SetsSectionController> sectionController =
[sectionControllers objectAtIndex:section];
if ([sectionController respondsToSelector:
@selector(tableView:titleForFooterInSection:)]) { //HERE
return [sectionController tableView:tableView
titleForFooterInSection:section];
}
return nil;
}
Run Code Online (Sandbox Code Playgroud)
继承我的完整文件.
#import <UIKit/UIKit.h>
@interface SettingsTableViewController : UITableViewController {
NSArray *sectionControllers;
}
@end
Run Code Online (Sandbox Code Playgroud)
我需要做些什么来修复错误?
我在我的应用程序中注意到我的取消按钮很难点击,看起来命中区域不在中心.
我该如何解决 ?
继承我的代码......
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@""
delegate:dg
cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil
otherButtonTitles: @"Help Pages", @"Tutorial",
@"Feedback / Questions ", @"Facebook Group", @"About", nil];
actionSheet.actionSheetStyle = UIActionSheetStyleBlackOpaque;
[actionSheet setTag:CommonUIActionSheetHelp];
[actionSheet showInView:vw];
[actionSheet release];
Run Code Online (Sandbox Code Playgroud) 我知道我不久前问了一个类似的问题,但我仍然有点不确定.同样的事情发生在几个地方.
'self'时使用的实例变量未设置为'[(super或self)init ...]的结果
一个
- (id)initWithCoder:(NSCoder *)decoder {
if (![super init]) return nil;
red = [decoder decodeFloatForKey:kRedKey]; //occurs here
green = [decoder decodeFloatForKey:kGreenKey];
blue = [decoder decodeFloatForKey:kBlueKey];
return self;
}
Run Code Online (Sandbox Code Playgroud)
乙
- (id)initWithFrame:(CGRect)frame title:(NSString*)str sideUp:(BOOL)up{
if(![super initWithFrame:frame]) return nil;
int y;
UIImage *img;
if(up){
img = [UIImage imageNamedTK:@"TapkuLibrary.bundle/Images/graph/popup"];
y = 5;
}else{
img = [UIImage imageNamedTK:@"TapkuLibrary.bundle/Images/graph/popdown"];
y = 14;
}
background = [[UIImageView alloc] initWithImage:img]; // occurs here
Run Code Online (Sandbox Code Playgroud)
C
- (id) initWithFrame:(CGRect)frame {
if(![super initWithFrame:frame]) return nil;
UILabel *titleBackground = …Run Code Online (Sandbox Code Playgroud) 我的iOS应用程序的完整版本如何从免费版本访问/复制数据库/设置?
我正在考虑提供我的应用程序的免费版本,我无法看到人们购买完整版本后如何从我的免费版本访问数据?
如果iOS5可用,我如何检查并有条件地编译/运行代码?
cocoa-touch ×7
objective-c ×7
ios ×6
iphone ×5
xcode ×5
analyzer ×2
cocoa ×1
protocols ×1
touch ×1
uitableview ×1