参考预先回答的问题:获取本周的第一天和最后一天
上面的链接有两个答案.其中一个是理论上的,另一个是PyObjC(Python-Objective C桥接语言),快速谷歌搜索确认PyObjC不适用于iPhone SDK.
因此,关于这个问题,如何将PyObjC代码翻译为与iPhone SDK兼容.
目标:假设今天(星期二)是19日,太阳.是第17次(周开始)和周六.23日是周末.我希望得到一个像19/01 - 23/01这样的字符串[即周的开始(hypen)周结束]
我安装了最新的iOS4 SDK,取代了我现有的SDK(所以我不再拥有3.2,4.0之外的任何东西).
我还从github查看了最新的Three20,现在每当我要构建一个新的Three20应用程序,或者甚至运行示例时,我都会收到以下错误:
Build Three20Core of project Three20Core with configuration Debug
Check dependencies
[BEROR]error: There is no SDK with the name or path 'iphonesimulator3.0'
Run Code Online (Sandbox Code Playgroud)
Three20还不兼容iOS4 SDK吗?
当我使用UIImagePickerController时cameraOverlayView,我可以从叠加视图中获得唯一的选区吗?
我几乎总是使用这种方法从数组中获取"Word1,Word2,Word3"('Word1','Word2','Word3')
它是最短或可接受的方法吗?更好的解决方案?
$sentence = '';
foreach ($words as $word) {
$sentence .= $word . ", ";
}
$final_sentence = substr($sentence, 0, -2);
echo $final_sentence; //outputs contents of $words array separated by ,
Run Code Online (Sandbox Code Playgroud)