我有一个tableview我想根据它有多少行进行自定义.
如果它没有行,我希望背景图像提示用户添加内容.如果它有1行或更多行,我希望它有不同的背景图像,以显示内容.
顺便说一句,我正在使用一个获取的结果控制器来填充我的tableview.
有任何想法吗?
我有一个显示正常的警报视图.在我的标题中,我已经包含了UIAlertViewDelegate,但出于某种原因,每当我点击警报视图上的按钮时,我的应用程序崩溃就会出现严重错误,并说已发送了无法识别的选择器.
任何想法都会有所帮助.我有完全相同的代码在其他类中运行完全没有问题.
这是我的代码:
-(void)deletePatient
{
NSLog(@"Delete");
//Patient *patientInRow = (Patient *)[[self fetchedResultsController] objectAtIndexPath:cellAtIndexPath];
NSMutableArray *visitsArray = [[NSMutableArray alloc] initWithArray:[patient.patientsVisits allObjects]];
//cellAtIndexPath = indexPath;
int visitsCount = [visitsArray count];
NSLog(@"Visit count is %i", visitsCount);
if (visitsCount !=0)
{
//Display AlertView
NSString *alertString = [NSString stringWithFormat:@"Would you like to delete %@'s data and all their visits and notes?", patient.nameGiven];
UIAlertView *alert1 = [[UIAlertView alloc] initWithTitle:alertString message:nil delegate:self cancelButtonTitle:@"Yes" otherButtonTitles:@"No",nil];
[alert1 show];
[alert1 release];
}
else if (visitsCount ==0)
{
//Do something else …Run Code Online (Sandbox Code Playgroud) 我正在 Cocoa 中为 Mac 开发一个非常简单的绘图应用程序,并尝试NSScrollView创建一个动态调整大小的绘图画布,但它似乎不起作用。
我希望NSView当我滚动(平移)时尺寸会增大,并且当我缩小时尺寸也会增大。显然,我设置了画布的最大大小来限制内存,但不知道从哪里开始。
有什么想法吗?另外,对于 iOS 或 UIKit 解决方案有什么想法吗?我可以根据需要进行调整。
iphone ×2
cocoa ×1
nsscrollview ×1
nsview ×1
swift ×1
uialertsheet ×1
uialertview ×1
uiscrollview ×1
uitableview ×1