XCode调试技巧之EXC_BAD_ACCESS中BUG解决是本文要介绍的内容,在iphone开发的时候EXC_BAD_ACCESS这个bug时不容易找到原因的,在网上找到的3个关于这个问题的方法,希望可以帮到你,我自己试了一下第一中方法,效果还不错 (continue reading…)
改变UIImage的大小
lazytable 例子
// Set appIcon and clear temporary data/image
UIImage *image = [[UIImage alloc] initWithData:self.activeDownload];
if (image.size.width != kAppIconHeight && image.size.height != kAppIconHeight)
{
CGSize itemSize = CGSizeMake(kAppIconHeight, kAppIconHeight);
UIGraphicsBeginImageContext(itemSize);
CGRect imageRect = CGRectMake(0.0, 0.0, itemSize.width, itemSize.height);
[image drawInRect:imageRect];
self.appRecord.appIcon = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
}
else
{
self.appRecord.appIcon = image;
}
self.activeDownload = nil;
[image release];
图片缩放到指定大小尺寸
- (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size{
// 创建一个bitmap的context
// 并把它设置成为当前正在使用的context
UIGraphicsBeginImageContext(size);
// 绘制改变大小的图片
[img drawInRect:CGRectMake(0, 0, size.width, size.height)];
// 从当前context中创建一个改变大小后的图片
UIImage* scaledImage = UIGraphicsGetImageFromCurrentImageContext();
// 使当前的context出堆栈
UIGraphicsEndImageContext();
// 返回新的改变大小后的图片
return scaledImage;
}
iOS高效开发必备的10款Objective-C类库
有很多第三方的iOS开发的Objective-C类库可以用来简化很多不必要的工作.经过作者团队的慎重讨论,他们评选出了10款能够极大提高iOS开发效率的类库,根据原文作者的评价来看,基本上有了这10款工具,做iOS开发就真的跟泡Cocoa一样了。 (continue reading…)
Objective-C语法快速参考
大部分有一点其他平台开发基础的初学者看到XCode,第一感想是磨拳擦掌,看到Interface Builder之后,第一感想是跃跃欲试,而看到Objective-C的语法,第一感想就变成就望而却步了。
如果你和我一样,对苹果相关的开发:Mac OS X或是iPhone有兴趣,但是第一时间看到Objective-C就会头疼并伴有发烧症状的话,疗效比较好的快速治疗方法是阅读本文。大概花二十分钟左右,而且绝不无聊的时间,你就会对Objective-C有那么一点点了解,至少读读例子不会那么头疼了。
不过假定你要有那么一点点C++、C#或是Java的基础,至少能看到C++、C#或是Java的源码,能够大致明白说得是什么。
这篇文章不是一篇科技文章,希望你也不要把它当做科技文章来读。文章非常不严谨,但是我相信你能看得懂。 (continue reading…)
TYPO3 – Sorry, you didn’t have proper permissions to perform this change
Wer evtl. selber beim arbeiten mit Typo3 auf diese Fehlermeldung stößt und evtl. nach einem Aufschluss sucht und bis jetztnoch keine Gefunden hat, dem hoffe ich mit diesem kleinen Hinweis auf dem Typo3-BugTracker zu helfen.
Quelle Typo3 BugTracker: 0018583: Changing or adding new elements in the backend is not possible anymore
Um dieses Problem zu umgehen könnt ihr entweder in die Listen-Ansicht wechseln, oder aber ihr fügt folgenden Code in der PhpMyAdmin Oberfläche aus. Und Arbeitet wirklich normal weiter.
ALTER TABLE pages ADD t3ver_swapmode tinyint(4) NOT NULL default ’0′
Dieser Code-Schnippsel erzeugt in der Tabelle eurer Typo3 Datenbank eine Spalte “pages”. Grund und Ursache des Problems Scheint das beliebte TemplaVoilá zu sein. Bei einer reinen Typoscript Programmierung hab eich das Poblem noch nicht gehabt! Aber das ganze ist ja schnell behoben.
Get tt_content uid
You fetch all tt_content’s data in array:
$this->cObj->data
ie:
$uidOfCE = $this->cObj->data['uid'];
If you’re using Extbase of course you need to get the content object first, ie:
$this->contentObj = $this->configurationManager->getContentObject();
debug($this->contentObj->data, "current tt_content's data");