我想知道在将其放入xCode的"摘要"选项卡后,是否有办法在代码中获取自己的应用程序版本.一种方法似乎是搜索Info.plist
的CFBundleVersion
关键,但没有任何其他的,更简单,更方便的方法?
我正在寻找一种方法来测试索引路径是否相等,并且相等我的意思是在每个级别上相等?我试过compare:
但似乎没有工作,相比之下,NSOrderedSame
即使索引绝对不一样,我也总是如此.
我是OpenGL ES 2.0的初学者,我正在寻找一本可以帮助我学习的好书/资源.我找到了几本书:
但阅读亚马逊的评论后,我发现他们要么承担以前的OpenGL知识,要么不是专为iOS编写的.(我知道OpenGL应该很容易移植,但我正在寻找一本带有C语言的书籍/资源,而不是C++,它讨论了iOS环境中的OpenGL)
我也发现了这一点,它确实帮助我掌握了基本概念,但不幸的是,它们涵盖了OpenGL ES 1.1,并且只描述了基础知识.
任何帮助,将不胜感激!
所以,我想知道为什么有些架构使用little-endian和其他big-endian.我记得我在某处看过它与性能有关,但是,我不明白字节序会如何影响它.我也知道:
The little-endian system has the property that the same value can be read from memory at different lengths without using different addresses.
这似乎是一个很好的功能,但是,即便如此,许多系统都使用big-endian,这可能意味着big-endian也有一些优势(如果是这样,哪个?).
我相信还有更多,最有可能深入到硬件水平.很想知道细节.
我有一个定制的UINavigationBar(不同的大小,背景等),在自定义标题视图中.我使用此代码来实现此目的:
UIView * mainView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
mainView.backgroundColor = [UIColor yellowColor];
UINavigationBar *navBar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0,0,kScreenWidth,80)];
navBar.autoresizingMask = UIViewAutoresizingFlexibleWidth;
UINavigationItem *currentItem = [[UINavigationItem alloc] init];
UILabel *label = [[UILabel alloc] init];
label.font = [UIFont fontWithName:@"Helvetica-Bold" size: 30.0];
[label setBackgroundColor:[UIColor clearColor]];
[label setTextColor:[UIColor whiteColor]];
[label setText:self.title];
[label sizeToFit];
[currentItem setTitleView:label];
[label release];
[navBar pushNavigationItem:currentItem animated:NO];
[currentItem release];
[mainView addSubview:navBar];
[navBar release];
self.view = mainView;
[mainView release];
Run Code Online (Sandbox Code Playgroud)
但是,我现在的问题是,即使正确添加了自定义标题视图,它也不会与NavBar垂直居中.我错过了什么?
谢谢!
我有一个非常基本的问题.我想知道这是否是Objective-C或C中的内置函数,以帮助我找到特定数字是否在某个范围内.我知道这可能是一个简单的问题,但我仍然没有找到答案.在短期内,我们希望避免在此测试中使用多个"if"和"else".
好的,首先我知道这可以在iOS(armv7)上编译,因为我阅读了文档.但是,我找不到合适的工具链.
那么,现在,我已经尝试过哪些工具链:
i686-apple-darwin10-cpp-4.2.1
i686-apple-darwin10-g++-4.2.1
i686-apple-darwin10-gcc-4.2.1
Run Code Online (Sandbox Code Playgroud)
以上交叉编译为x86(我在i386上).工作良好.但我不需要它
arm-apple-darwin10-cpp-4.2.1
arm-apple-darwin10-g++-4.2.1
arm-apple-darwin10-gcc-4.2.1
Run Code Online (Sandbox Code Playgroud)
以上编译很好,但不会像我预期的那样交叉编译到arm,相反,它只是编译到我当前的arch.
我是这个问题的真正初学者,事实上这是我第一次尝试交叉编译.
更新:
以下是我尝试过的命令(这是针对armv6; armv7类似):
配置:
../llvm/configure --host=arm-apple-darwin6 --target=arm-apple-darwin6
--build=i386-apple-darwin --enable-optimized --disable-debug
--disable-expensive-checks --disable-doxygen --disable-threads
Run Code Online (Sandbox Code Playgroud)
env vars:
export DEVROOT=/Developer/Platforms/iPhoneOS.platform/Developer
export SDKROOT=$DEVROOT/SDKs/iPhoneOS$IOS_BASE_SDK.sdk
export CFLAGS="-arch armv6 -pipe -no-cpp-precomp -isysroot $SDKROOT -miphoneos-version-min=$IOS_DEPLOY_TGT -I$SDKROOT/usr/include/"
export CPP="$DEVROOT/usr/bin/arm-apple-darwin10-cpp-4.2.1"
export CXX="$DEVROOT/usr/bin/arm-apple-darwin10-g++-4.2.1"
export CXXCPP="$DEVROOT/usr/bin/arm-apple-darwin10-cpp-4.2.1"
export CC="$DEVROOT/usr/bin/arm-apple-darwin10-gcc-4.2.1"
export LD=$DEVROOT/usr/bin/ld
export AR=$DEVROOT/usr/bin/ar
export AS=$DEVROOT/usr/bin/as
export NM=$DEVROOT/usr/bin/nm
export RANLIB=$DEVROOT/usr/bin/ranlib
export LDFLAGS="-L$SDKROOT/usr/lib/"
export CPPFLAGS=$CFLAGS
export CXXFLAGS=$CFLAGS
Run Code Online (Sandbox Code Playgroud)
更新:此交叉编译的目的是使armv7(armv6)库不是命令行工具.
再来一次更新:我使用了以下内容:
CC="$DEVROOT/usr/bin/clang"
CXX="$DEVROOT/usr/bin/clang++"
./llvm/configure --host=i386-apple-darwin --target=armv7-apple-darwin --build=armv7-apple-darwin --enable-optimized --disable-debug --disable-expensive-checks --disable-doxygen --disable-threads --enable-targets=arm
Run Code Online (Sandbox Code Playgroud)
我设法checking whether …
我有一个包含的ipad popover UITableView
.填充表后,它通常只有几个项目(4-5),所以我正在寻找一种方法来将popover(contentSizeForViewInPopover
)的大小调整为实际的表高度(所有单元格的总高度).
所以,我有高度,但我不知道在哪里打电话contentSizeForViewInPopover
,我曾尝试调用它:viewDidAppear
和viewWillAppear
,但没有成功,因为它似乎是表被填充后,实际高度只有稍后提供.
有什么想法吗?谢谢!
编辑:我的细胞根据它们携带的内容有不同的高度,我不能预先计算高度 noOfRows * cellHeight
.
cocoa-touch objective-c uitableview ipad uipopovercontroller
我整个早上一直在反对这个问题.
我已经建立了与数据源的连接,该数据源返回音频数据(它是一个记录设备,因此数据上没有设置长度.数据只是流入.就像,如果你打开一个流到收音机)
我已经设法在我的代码中接收所有数据包.现在我只需要玩它.我想播放即将发布的数据,所以我不想排队几分钟或者其他什么,我想使用我在那个时刻收到的数据并播放它.
现在我整个上午一直在寻找不同的例子,但没有一个真的被列出来.
在里面
功能,"数据"包是音频包.我尝试使用AVPlayer,MFVideoPlayer进行流媒体播放,但到目前为止我没有任何工作.还试着看看mattgallagher的Audiostreamer,但仍然无法实现它.
这里的任何人都可以提供帮助,有一些(最好)工作实例吗
float myArray[myArraySize] = {1};
Run Code Online (Sandbox Code Playgroud)
在上面的表达式中,只有第一个元素是init和1.如何使用复合文字(不是memset)初始化所有带元素的元素?
我在unix上使用GCC 4.2进行编译.
iphone ×5
objective-c ×5
c ×3
cocoa-touch ×3
ios ×3
ipad ×2
arm ×1
arrays ×1
c++ ×1
c99 ×1
core-audio ×1
endianness ×1
gcc ×1
gcc4 ×1
nsindexpath ×1
opengl-es ×1
uitableview ×1
xcode ×1