这很可能是一个愚蠢的错误,但任何人都可以告诉我为什么我的图标在Blend中显示,但不在模拟器中(而不是在VS10中,但这不是真正的问题)?
编辑 - 这是我的XAML:
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
<shell:ApplicationBarIconButton IconUri="/Images/share.png" Text="Partager"/>
<shell:ApplicationBarIconButton IconUri="/Images/appbar.edit.rest.png" Text="Note"/>
<shell:ApplicationBarIconButton IconUri="/Images/appbar.feature.camera.rest.png" Text="Photos/Vidéos"/>
<shell:ApplicationBarIconButton IconUri="/Images/calendar.png" Text="Rendez-vous"/>
<shell:ApplicationBar.MenuItems>
<shell:ApplicationBarMenuItem Text="MenuItem 1"/>
<shell:ApplicationBarMenuItem Text="MenuItem 2"/>
</shell:ApplicationBar.MenuItems>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
Run Code Online (Sandbox Code Playgroud)
我的四个.png文件是48x48,带有黑色前景的透明.png ,因为这样的appbar.*.rest.png
文件在Microsoft图标文件夹中找到
我试图将NSAttributedString存储到Core Data SQL存储.
我将属性设置为"可转换",它是可选的,它不是瞬态的或索引的,并且值转换器名称设置为默认值"NSKeyedUnarchiveFromData".在.xcdatamodel中并生成在.h中具有此内容的托管对象类:
@property (nonatomic, retain) id Text; (I have tried changing id to NSAttributedString *Text)
Run Code Online (Sandbox Code Playgroud)
这在.m中:
@dynamic Text;
Run Code Online (Sandbox Code Playgroud)
我查看并将我的NSManagedObject的".text"属性设置为属性字符串,然后在完成时执行:
NSError *error = nil;
[managedObjectContext save:&error];
Run Code Online (Sandbox Code Playgroud)
此过程导致输出中出现此错误:
[NSCFType encodeWithCoder:]:发送到实例0xc04edb0的无法识别的选择器由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:' * - [NSCFType encodeWithCoder:]:无法识别的选择器发送到实例0xc04edb0'
我已经检查了我存储到属性的类的类,它NSAttributedString
也是我检查responsesToSelector @selector(:)
并返回true,所以非常困惑,因为这与错误消息相反?
请指教.
谢谢詹姆斯
我正在构建一个我作为宝石捆绑的引擎(gmaps4rails).我在我的rails应用程序的/ public中复制了我的引擎的/ public.
一切都在开发中工作正常,但无法在生产中工作:看起来没有找到静态资产(我的引擎和我的主应用程序).
日志告诉以下内容(只是一个摘要):
Started GET "/javascripts/application.js?1286294679" for 127.0.0.1 at Wed Nov 24 00:22:20 +0100 2010
ActionController::RoutingError (No route matches "/javascripts/application.js"):
Rendered /Users/me/.rvm/rubies/ree-1.8.7-2010.02/lib/ruby/gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.1ms)
Started GET "/stylesheets/gmaps4rails.css?1290554221" for 127.0.0.1 at Wed Nov 24 00:22:20 +0100 2010
ActionController::RoutingError (No route matches "/stylesheets/gmaps4rails.css"):
Run Code Online (Sandbox Code Playgroud)
我做了一些事情:
在我的应用程序的production.rb中,我设置:
config.serve_static_assets = true
这解决了问题,但不够优雅,我想保持它为假并在引擎中添加配置:)
我按照这里的建议没有成功.
我试图通过nnimap连接gnus来从Exchange服务器读取邮件.在gnus启动中定义的是配置信息
(setq gnus-select-method '(nnimap "example"
(nnimap-address "mail.server.com")
(nnimap-server-port 443)
(nnimap-authenticator login)
(nnimap-stream ssl)
(remove-prefix "INBOX.")
(nnimap-authinfo-file "~/.imap-authinfo")))
(setq imap-ssl-program "openssl s_client -quiet -tls1 -connect %s:%p")
Run Code Online (Sandbox Code Playgroud)
Emacs是@ 24.0.50.1 (2010-11-16
)并.imap-authinfo
包含连接信息:
machine mail.server.com login my_username password my_password
Run Code Online (Sandbox Code Playgroud)
使用openssl和gnutls-cli我可以独立连接到服务器,但是当调用gnus并留下消息时,emacs会挂起Opening TLS connection with gnutls-cli --insecure -p 443 mail.server.com'...done
.
如何在sqllite数据库上使用SQL语句以UTC格式插入当前日期.我发现了这个NOW
功能但是它的格式是什么?这将在移动设备上,因此每个人都有不同的区域设置,但是,我需要一个标准的时间格式,因为设备会将日期与我的服务器进行比较.
此外,有没有一种方法可以在MySQL中更改行中的数据时自动更新"已修改"字段?
这是一个真正的新手问题,我希望你能原谅我.我想知道,我可以直接在.aspx文件中放if
两个声明<%
%>
吗?如果是这样,怎么......?
我遇到的具体问题是:我想将用户的HTTP Referrer作为参数放在他们点击的链接中(这听起来非常违反直觉,但我有理由这样做!).
所以我的问题是有时会Request.UrlReferrer
返回一个空值.为了解决这个问题,我希望提出类似的东西:
<%# if(Request.UrlReferrer != null) { Server.UrlEncode(Request.UrlReferrer.ToString()) } %>
Run Code Online (Sandbox Code Playgroud)
但它不起作用......("错误:无效的表达术语'如果'").
谢谢你的帮助!
我有一个使用自动依赖项生成的C++程序的Makefile.%.d配方取自GNU Make手册.
问题是以某种方式将"Makefile"添加为目标,然后隐式规则使其假定它是可执行文件并使用我的src /%.cpp规则来尝试编译src/Makefile.cpp.查看调试信息时,这总是在执行include之后发生.
No need to remake target `build/Sprite.d'.
Considering target file `Makefile'.
Looking for an implicit rule for `Makefile'.
...
Trying pattern rule with stem `Makefile'.
Trying implicit prerequisite `Makefile.o'.
Looking for a rule with intermediate file `Makefile.o'.
Run Code Online (Sandbox Code Playgroud)
我知道包含原因如果需要,可以重建给定的Makefile.它是否也尝试重建当前的Makefile?如果是这样,我如何阻止它,如果没有,那么为什么"Makefile"被添加为目标呢?
此外,执行include,即使我在命令行上指定目标,也会重新生成.d文件,例如make clean
.有没有办法阻止这种情况发生?
# $(call setsuffix,newsuffix,files)
# Replaces all the suffixes of the given list of files.
setsuffix = $(foreach file,$2,$(subst $(suffix $(file)),$1,$(file)))
# $(call twinfile,newdir,newsuffix,oldfile)
# Turns a path to one file into a path to a …
Run Code Online (Sandbox Code Playgroud) 有一个坐标对象有三个变量纬度(NSNumber),经度(NSNumber)和时间(NSDate),为了检查我的模拟器上的程序,我给了下面的代码
[coordinate setLatitude:[NSNumber numberWithDouble:23.234223]];
[coordinate setLongitude:[NSNumber numberWithDouble:73.234323]];
Run Code Online (Sandbox Code Playgroud)
但是当我NSLog coordinate.latitude和coordinate.longitude时,它会显示0.00000
NSLog(@"cordlat : %f",coordinate.latitude);
NSLog(@"cordlong : %f",coordinate.longitude);
Run Code Online (Sandbox Code Playgroud)
可能是什么问题???
首先,这是上ListBox
一篇文章,它处理ObservableCollection<Account>
从AccountsCollection.cs
类中绑定到我的帐户的AccountListBox数据.
所以现在我有一个绑定对象AccountsCollection和一个名为AccountTemplate的DataTemplate,用于我在资源中定义的ListBox:
<Window.Resources>
<controller:AccountsWindowController x:Key="AccountsCollection" />
<DataTemplate x:Key="AccountTemplate">
<DockPanel>
<Button Name="EditButton"
DockPanel.Dock="Right"
Margin="3 0 3 0"
VerticalAlignment="Center"
Content="Edit" />
<Button Name="DeleteButton"
DockPanel.Dock="Right"
Margin="3 0 3 0"
VerticalAlignment="Center"
Content="Delete" />
<TextBlock Name="AccountName"
VerticalAlignment="Center"
Text="{Binding Name}"
TextWrapping="NoWrap"
TextTrimming="CharacterEllipsis" />
</DockPanel>
</DataTemplate>
<Window.Resources>
Run Code Online (Sandbox Code Playgroud)
以下是与LisBox本身相关的代码:
<ListBox Name="AccountsListBox"
Margin="12,38,12,41"
HorizontalContentAlignment="Stretch"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ItemsSource="{Binding Accounts,
Source={StaticResource ResourceKey=AccountsCollection}}"
ItemTemplate="{StaticResource ResourceKey=AccountTemplate}"
MouseDoubleClick="AccountsListBox_MouseDoubleClick">
</ListBox>
Run Code Online (Sandbox Code Playgroud)
我希望我的列表能够通过起始字母对所有帐户进行分组,并在列表中显示该字母(我也想将一些设计应用于该字母标题).最终结果应该是这样的:
感谢您的帮助!
更新:这是成功实现分组的代码.
<Window x:Class="Gui.Wpf.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:entities="clr-namespace:Entities.Accounts;assembly=Entities"
xmlns:contollers="clr-namespace:Gui.Wpf.Controllers"
xmlns:converters="clr-namespace:Gui.Wpf.Converters"
xmlns:componentModel="clr-namespace:System.ComponentModel;assembly=WindowsBase"
Title="MainWindow"
Width="525"
Height="350" > …
Run Code Online (Sandbox Code Playgroud) 我有一个现有的Silverlight应用程序已经运行了几个月,有很多用户.本周我们有一个新用户尝试使用该应用程序,但他不断收到此错误消息.
用户代理:Mozilla/4.0(兼容; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727)时间戳:Wed,24 Nov 2010 03:49:04 UTC
消息:Silverlight应用程序代码中的未处理错误:2104
类别:InitializeError
消息:2104发生错误.
我们在Windows 2008 R2上运行IIS 7.5,用户安装了Silverlight 4(4.0.50826.0).
知道什么可能是错的吗?