[Mono-bugs] [Bug 679632] New: ALAssetsGroup.Name property throws error

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Tue Mar 15 01:51:31 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=679632

https://bugzilla.novell.com/show_bug.cgi?id=679632#c0


           Summary: ALAssetsGroup.Name property throws error
    Classification: Mono
           Product: MonoTouch
           Version: SVN
          Platform: Macintosh
        OS/Version: Mac OS X 10.6
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: Runtime
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: bryancostanich at hotmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Customer
           Blocker: No


Created an attachment (id=419315)
 --> (http://bugzilla.novell.com/attachment.cgi?id=419315)
solution file

if i run the following code on a device:

namespace Example_SharedResources.Screens.iPhone.PhotoLibrary
{
    public class AlbumsController : UITableViewController
    {
        ALAssetsLibrary _assetsLibrary;

        public AlbumsController ()
        {
        }

        public override void ViewDidLoad ()
        {
            base.ViewDidLoad ();

            //---- instantiate a reference to the shared assets library
            this._assetsLibrary = new ALAssetsLibrary();
            //---- enumerate the photo albums
            this._assetsLibrary.Enumerate(ALAssetsGroupType.All
                , this.GroupsEnumerator
                , (NSError e) => { Console.WriteLine("Could not enumerate
albums: " + e.LocalizedDescription); });
        }

        /// <summary>
        /// Called for each group that is enumerated
        /// </summary>
        protected void GroupsEnumerator(ALAssetsGroup group, ref bool stop)
        {
            //---- when the enumeration is completed, this method is invoked
with group set to null
            if (group != null)
            {
                //---- don't stop, baby
                stop = false;

                //---- photos and videos. could also pass AllVideos, AllVideos,
etc.
                group.SetAssetsFilter(ALAssetsFilter.AllAssets);

                if(group.Name != null)
                { Console.WriteLine("Group Name: " + group.Name); }

                //start the asset enumeration
                //with ALAssetsGroup's Enumerate method
                //group.Enumerate(this.AssetEnumerator);
            }
            else { Console.WriteLine("Group enumeration completed."); }
        }

        protected void AssetEnumerator()
        {

        }
    }
}

i seem to get the following error:
System.ArgumentNullException: Argument cannot be null.
Parameter name: property
  at MonoTouch.AssetsLibrary.ALAssetsGroup.ValueForProperty
(MonoTouch.Foundation.NSString property) [0x00000] in <filename unknown>:0 
  at MonoTouch.AssetsLibrary.ALAssetsGroup.get_Name () [0x00000] in <filename
unknown>:0 
  at
Example_SharedResources.Screens.iPhone.PhotoLibrary.AlbumsController.GroupsEnumerator
(MonoTouch.AssetsLibrary.ALAssetsGroup group, System.Boolean& stop) [0x00014]
in
/Users/bryancostanich/Projects/MonoTouch_Book/Example_SharedResources/Example_SharedResources/Screens/iPhone/PhotoLibrary/AlbumsController.cs:42 
  at
MonoTouch.AssetsLibrary.ALAssetsLibrary.TrampolineALAssetsLibraryGroupsEnumerationResultsDelegate
(IntPtr block, IntPtr group, System.Boolean& stop) [0x00000] in <filename
unknown>:0 
  at (wrapper native-to-managed)
MonoTouch.AssetsLibrary.ALAssetsLibrary:TrampolineALAssetsLibraryGroupsEnumerationResultsDelegate
(intptr,intptr,int&)
  at MonoTouch.UIKit.UIApplication.Main (System.String[] args, System.String
principalClassName, System.String delegateClassName) [0x00000] in <filename
unknown>:0 
  at Example_SharedResources.Application.Main (System.String[] args) [0x00000]
in
/Users/bryancostanich/Projects/MonoTouch_Book/Example_SharedResources/Example_SharedResources/Application.cs:12 

on this line:

if(group.Name != null)


repro attached. launch application, choose "Photo/Video Album List"

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list